Index: pkg/compiler/lib/src/resolution/members.dart |
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart |
index ec76e76cf277e35bc20d96b45d55eb9b8caa0229..3d0b619cc29e3202a49b5bfed2426c2d66b7f037 100644 |
--- a/pkg/compiler/lib/src/resolution/members.dart |
+++ b/pkg/compiler/lib/src/resolution/members.dart |
@@ -17,7 +17,6 @@ import '../dart_types.dart'; |
import '../elements/elements.dart'; |
import '../elements/modelx.dart' |
show |
- BaseFunctionElementX, |
ConstructorElementX, |
ErroneousElementX, |
FunctionElementX, |
@@ -144,7 +143,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> { |
ResolverVisitor( |
Compiler compiler, Element element, ResolutionRegistry registry, |
- {Scope scope, bool useEnclosingScope: false}) |
+ {bool useEnclosingScope: false}) |
: this.enclosingElement = element, |
// When the element is a field, we are actually resolving its |
// initial value, which should not have access to instance |
@@ -154,9 +153,9 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> { |
this.currentClass = |
element.isClassMember ? element.enclosingClass : null, |
this.statementScope = new StatementScope(), |
- this.scope = scope ?? (useEnclosingScope |
+ scope = useEnclosingScope |
? Scope.buildEnclosingScope(element) |
- : element.buildScope()), |
+ : element.buildScope(), |
// The type annotations on a typedef do not imply type checks. |
// TODO(karlklose): clean this up (dartbug.com/8870). |
inCheckContext = compiler.options.enableTypeAssertions && |
@@ -409,21 +408,16 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> { |
if (node.modifiers.isStatic && enclosingElement.kind != ElementKind.CLASS) { |
reporter.reportErrorMessage(node, MessageKind.ILLEGAL_STATIC); |
} |
- FunctionSignature functionSignature = function.functionSignature; |
- // Create the scope where the type variables are introduced, if any. |
scope = new MethodScope(scope, function); |
- functionSignature.typeVariables.forEach( |
- (DartType type) => addToScope(type.element)); |
- |
- // Create the scope for the function body, and put the parameters in scope. |
- scope = new BlockScope(scope); |
+ // Put the parameters in scope. |
+ FunctionSignature functionParameters = function.functionSignature; |
Link<Node> parameterNodes = |
(node.parameters == null) ? const Link<Node>() : node.parameters.nodes; |
- functionSignature.forEachParameter((ParameterElementX element) { |
+ functionParameters.forEachParameter((ParameterElementX element) { |
// TODO(karlklose): should be a list of [FormalElement]s, but the actual |
// implementation uses [Element]. |
- List<Element> optionals = functionSignature.optionalParameters; |
+ List<Element> optionals = functionParameters.optionalParameters; |
if (!optionals.isEmpty && element == optionals.first) { |
NodeList nodes = parameterNodes.head; |
parameterNodes = nodes.nodes; |
@@ -452,14 +446,14 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> { |
parameterNodes = parameterNodes.tail; |
}); |
addDeferredAction(enclosingElement, () { |
- functionSignature |
+ functionParameters |
.forEachOptionalParameter((ParameterElementX parameter) { |
parameter.constant = |
compiler.resolver.constantCompiler.compileConstant(parameter); |
}); |
}); |
if (inCheckContext) { |
- functionSignature.forEachParameter((ParameterElement element) { |
+ functionParameters.forEachParameter((ParameterElement element) { |
registry.registerTypeUse(new TypeUse.checkedModeCheck(element.type)); |
}); |
} |
@@ -576,13 +570,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> { |
name, node, ElementKind.FUNCTION, Modifiers.EMPTY, enclosingElement); |
ResolverTask.processAsyncMarker(compiler, function, registry); |
function.functionSignature = SignatureResolver.analyze( |
- compiler, |
- scope, |
- node.typeVariables, |
- node.parameters, |
- node.returnType, |
- function, |
- registry, |
+ compiler, node.parameters, node.returnType, function, registry, |
createRealParameters: true, |
isFunctionExpression: !inFunctionDeclaration); |
checkLocalDefinitionName(node, function); |
@@ -1876,7 +1864,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> { |
ResolutionResult handleTypeVariableTypeLiteralAccess( |
Send node, Name name, TypeVariableElement element) { |
AccessSemantics semantics; |
- if (!Elements.hasAccessToTypeVariable(enclosingElement, element)) { |
+ if (!Elements.hasAccessToTypeVariables(enclosingElement)) { |
// TODO(johnniwinther): Add another access semantics for this. |
ErroneousElement error = reportAndCreateErroneousElement( |
node, |
@@ -1917,7 +1905,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> { |
ResolutionResult handleTypeVariableTypeLiteralUpdate( |
SendSet node, Name name, TypeVariableElement element) { |
AccessSemantics semantics; |
- if (!Elements.hasAccessToTypeVariable(enclosingElement, element)) { |
+ if (!Elements.hasAccessToTypeVariables(enclosingElement)) { |
// TODO(johnniwinther): Add another access semantics for this. |
ErroneousElement error = reportAndCreateErroneousElement( |
node, |