Index: pkg/front_end/lib/src/fasta/parser/parser.dart |
diff --git a/pkg/front_end/lib/src/fasta/parser/parser.dart b/pkg/front_end/lib/src/fasta/parser/parser.dart |
index 6349b00a0fde810e23bb733cb5813dae6668a502..f7d33a5bcf633663faa64c8d5c7c509c678fa2c9 100644 |
--- a/pkg/front_end/lib/src/fasta/parser/parser.dart |
+++ b/pkg/front_end/lib/src/fasta/parser/parser.dart |
@@ -531,15 +531,15 @@ class Parser { |
} |
} |
- // Generalized function types don't allow inline function types. |
- // The following isn't allowed: |
- // int Function(int bar(String x)). |
if (optional('(', token)) { |
Token inlineFunctionTypeStart = token; |
listener.beginFunctionTypedFormalParameter(token); |
listener.handleNoTypeVariables(token); |
token = parseFormalParameters(token); |
listener.endFunctionTypedFormalParameter(token); |
+ // Generalized function types don't allow inline function types. |
+ // The following isn't allowed: |
+ // int Function(int bar(String x)). |
if (inFunctionType) { |
reportRecoverableError( |
inlineFunctionTypeStart, ErrorKind.InvalidInlineFunctionType); |
@@ -550,6 +550,9 @@ class Parser { |
token = parseTypeVariablesOpt(token); |
token = parseFormalParameters(token); |
listener.endFunctionTypedFormalParameter(token); |
+ // Generalized function types don't allow inline function types. |
+ // The following isn't allowed: |
+ // int Function(int bar(String x)). |
if (inFunctionType) { |
reportRecoverableError( |
inlineFunctionTypeStart, ErrorKind.InvalidInlineFunctionType); |