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

Unified Diff: pkg/compiler/lib/src/resolution/signatures.dart

Issue 2638063003: Reverts the following two commits: (Closed)
Patch Set: Created 3 years, 11 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/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 7fd39eea469fc8f423e5e8248e6e64fa467468ed..ae39454ca961667060499877c13bbffcf1d8e08f 100644
--- a/pkg/compiler/lib/src/resolution/signatures.dart
+++ b/pkg/compiler/lib/src/resolution/signatures.dart
@@ -94,9 +94,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);
@@ -115,8 +113,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,
@@ -138,14 +135,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));
@@ -202,15 +198,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;
@@ -434,7 +421,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);
});
@@ -449,7 +436,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) {
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution_common.dart ('k') | pkg/compiler/lib/src/resolution/type_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698