Index: pkg/compiler/lib/src/resolution/signatures.dart |
diff --git a/pkg/compiler/lib/src/resolution/signatures.dart b/pkg/compiler/lib/src/resolution/signatures.dart |
index 58e9177e091aa199f43d04501bd2fb865e2d9bf5..ac7b6d847833a9eef77a2036176213907bb5d8ad 100644 |
--- a/pkg/compiler/lib/src/resolution/signatures.dart |
+++ b/pkg/compiler/lib/src/resolution/signatures.dart |
@@ -93,9 +93,7 @@ class SignatureResolver extends MappingVisitor<FormalElementX> { |
reporter.internalError(node, 'function type parameters not supported'); |
} |
currentDefinitions = node; |
- FormalElementX element = definition == null |
- ? createUnnamedParameter() // This happens in function types. |
- : definition.accept(this); |
+ FormalElementX element = definition.accept(this); |
if (currentDefinitions.metadata != null) { |
element.metadataInternal = |
resolution.resolver.resolveMetadata(element, node); |
@@ -114,8 +112,7 @@ class SignatureResolver extends MappingVisitor<FormalElementX> { |
void computeParameterType(FormalElementX element, |
[VariableElement fieldElement]) { |
- // Function-type as in `foo(int bar(String x))` |
- void computeInlineFunctionType(FunctionExpression functionExpression) { |
+ void computeFunctionType(FunctionExpression functionExpression) { |
FunctionSignature functionSignature = SignatureResolver.analyze( |
resolution, |
scope, |
@@ -137,14 +134,13 @@ class SignatureResolver extends MappingVisitor<FormalElementX> { |
assert(invariant(currentDefinitions, link.tail.isEmpty)); |
if (link.head.asFunctionExpression() != null) { |
// Inline function typed parameter, like `void m(int f(String s))`. |
- computeInlineFunctionType(link.head); |
+ computeFunctionType(link.head); |
} else if (link.head.asSend() != null && |
link.head.asSend().selector.asFunctionExpression() != null) { |
// Inline function typed initializing formal or |
// parameter with default value, like `C(int this.f(String s))` or |
// `void m([int f(String s) = null])`. |
- computeInlineFunctionType( |
- link.head.asSend().selector.asFunctionExpression()); |
+ computeFunctionType(link.head.asSend().selector.asFunctionExpression()); |
} else { |
assert(invariant(currentDefinitions, |
link.head.asIdentifier() != null || link.head.asSend() != null)); |
@@ -201,15 +197,6 @@ class SignatureResolver extends MappingVisitor<FormalElementX> { |
return parameter; |
} |
- FormalElementX createUnnamedParameter() { |
- FormalElementX parameter; |
- assert(!createRealParameters); |
- parameter = new FormalElementX.unnamed( |
- ElementKind.PARAMETER, enclosingElement, currentDefinitions); |
- computeParameterType(parameter); |
- return parameter; |
- } |
- |
InitializingFormalElementX createFieldParameter( |
Send node, Expression initializer) { |
InitializingFormalElementX element; |
@@ -439,7 +426,7 @@ class SignatureResolver extends MappingVisitor<FormalElementX> { |
List<Element> orderedOptionalParameters = |
visitor.optionalParameters.toList(); |
if (visitor.optionalParametersAreNamed) { |
- // TODO(karlklose); replace when [visitor.optionalParameters] is a [List]. |
+ // TODO(karlklose); replace when [visitor.optinalParameters] is a [List]. |
orderedOptionalParameters.sort((Element a, Element b) { |
return a.name.compareTo(b.name); |
}); |
@@ -454,7 +441,7 @@ class SignatureResolver extends MappingVisitor<FormalElementX> { |
namedParameterTypes = |
namedParameterTypesBuilder.toLink().toList(growable: false); |
} else { |
- // TODO(karlklose); replace when [visitor.optionalParameters] is a [List]. |
+ // TODO(karlklose); replace when [visitor.optinalParameters] is a [List]. |
LinkBuilder<ResolutionDartType> optionalParameterTypesBuilder = |
new LinkBuilder<ResolutionDartType>(); |
for (FormalElement parameter in visitor.optionalParameters) { |