Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 668083002: Better recovery for getters in functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/generated/parser_test.dart
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index d3d0117dd31bb355076d738b562ec9a98c785129..78bee700a0078d76774f0bb1357836da0562dc57 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -922,14 +922,22 @@ class ErrorParserTest extends ParserTestCase {
ParserTestCase.parseCompilationUnit("void f(var x()) {}", [ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR]);
}
- void test_getterInFunction_block() {
+ void test_getterInFunction_block_noReturnType() {
ParserTestCase.parseStatement("get x { return _x; }", [ParserErrorCode.GETTER_IN_FUNCTION]);
}
- void test_getterInFunction_expression() {
+ void test_getterInFunction_block_returnType() {
+ ParserTestCase.parseStatement("int get x { return _x; }", [ParserErrorCode.GETTER_IN_FUNCTION]);
+ }
+
+ void test_getterInFunction_expression_noReturnType() {
ParserTestCase.parseStatement("get x => _x;", [ParserErrorCode.GETTER_IN_FUNCTION]);
}
+ void test_getterInFunction_expression_returnType() {
+ ParserTestCase.parseStatement("int get x => _x;", [ParserErrorCode.GETTER_IN_FUNCTION]);
+ }
+
void test_getterWithParameters() {
ParserTestCase.parse3("parseClassMember", <Object> ["C"], "int get x() {}", [ParserErrorCode.GETTER_WITH_PARAMETERS]);
}

Powered by Google App Engine
This is Rietveld 408576698