Index: pkg/analyzer/lib/src/fasta/ast_builder.dart |
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart |
index e9c43d98a0694389ecde59ea50045057b0e539a6..5a7a7f6b5e5725dfd797a365a0affa4fc8c68e1e 100644 |
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart |
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart |
@@ -1571,15 +1571,31 @@ class AstBuilder extends ScopeListener { |
_Modifiers modifiers = pop(); |
List<Annotation> metadata = pop(); |
Comment comment = pop(); |
+ |
+ // Decompose the preliminary ConstructorName into the type name and |
+ // the actual constructor name. |
+ SimpleIdentifier returnType; |
+ analyzer.Token period; |
+ SimpleIdentifier name; |
+ Identifier typeName = constructorName.type.name; |
+ if (typeName is SimpleIdentifier) { |
+ returnType = typeName; |
+ } else if (typeName is PrefixedIdentifier) { |
+ returnType = typeName.prefix; |
+ period = typeName.period; |
+ name = |
+ ast.simpleIdentifier(typeName.identifier.token, isDeclaration: true); |
+ } |
+ |
push(ast.constructorDeclaration( |
comment, |
metadata, |
toAnalyzerToken(modifiers?.externalKeyword), |
toAnalyzerToken(modifiers?.finalConstOrVarKeyword), |
toAnalyzerToken(factoryKeyword), |
- constructorName.type.name, |
- constructorName.period, |
- constructorName.name, |
+ ast.simpleIdentifier(returnType.token), |
+ period, |
+ name, |
parameters, |
toAnalyzerToken(separator), |
null, |