OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library dart2js.resolution.signatures; | 5 library dart2js.resolution.signatures; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/resolution.dart'; | 8 import '../common/resolution.dart'; |
9 import '../elements/resolution_types.dart'; | 9 import '../elements/resolution_types.dart'; |
10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 87 } |
88 if (node.modifiers.isStatic) { | 88 if (node.modifiers.isStatic) { |
89 reporter.reportErrorMessage(node, MessageKind.FORMAL_DECLARED_STATIC); | 89 reporter.reportErrorMessage(node, MessageKind.FORMAL_DECLARED_STATIC); |
90 } | 90 } |
91 | 91 |
92 if (currentDefinitions != null) { | 92 if (currentDefinitions != null) { |
93 reporter.internalError(node, 'function type parameters not supported'); | 93 reporter.internalError(node, 'function type parameters not supported'); |
94 } | 94 } |
95 currentDefinitions = node; | 95 currentDefinitions = node; |
96 FormalElementX element = definition == null | 96 FormalElementX element = definition == null |
97 ? createUnnamedParameter() // This happens in function types. | 97 ? createUnnamedParameter() // This happens in function types. |
98 : definition.accept(this); | 98 : definition.accept(this); |
99 if (currentDefinitions.metadata != null) { | 99 if (currentDefinitions.metadata != null) { |
100 element.metadataInternal = | 100 element.metadataInternal = |
101 resolution.resolver.resolveMetadata(element, node); | 101 resolution.resolver.resolveMetadata(element, node); |
102 } | 102 } |
103 currentDefinitions = null; | 103 currentDefinitions = null; |
104 return element; | 104 return element; |
105 } | 105 } |
106 | 106 |
107 void validateName(Identifier node) { | 107 void validateName(Identifier node) { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 ElementKind.PARAMETER, enclosingElement, currentDefinitions, name); | 198 ElementKind.PARAMETER, enclosingElement, currentDefinitions, name); |
199 } | 199 } |
200 computeParameterType(parameter); | 200 computeParameterType(parameter); |
201 return parameter; | 201 return parameter; |
202 } | 202 } |
203 | 203 |
204 FormalElementX createUnnamedParameter() { | 204 FormalElementX createUnnamedParameter() { |
205 FormalElementX parameter; | 205 FormalElementX parameter; |
206 assert(!createRealParameters); | 206 assert(!createRealParameters); |
207 parameter = new FormalElementX.unnamed( | 207 parameter = new FormalElementX.unnamed( |
208 ElementKind.PARAMETER, enclosingElement, currentDefinitions); | 208 ElementKind.PARAMETER, enclosingElement, currentDefinitions); |
209 computeParameterType(parameter); | 209 computeParameterType(parameter); |
210 return parameter; | 210 return parameter; |
211 } | 211 } |
212 | 212 |
213 InitializingFormalElementX createFieldParameter( | 213 InitializingFormalElementX createFieldParameter( |
214 Send node, Expression initializer) { | 214 Send node, Expression initializer) { |
215 InitializingFormalElementX element; | 215 InitializingFormalElementX element; |
216 Identifier receiver = node.receiver.asIdentifier(); | 216 Identifier receiver = node.receiver.asIdentifier(); |
217 if (receiver == null || !receiver.isThis()) { | 217 if (receiver == null || !receiver.isThis()) { |
218 reporter.reportErrorMessage(node, MessageKind.INVALID_PARAMETER); | 218 reporter.reportErrorMessage(node, MessageKind.INVALID_PARAMETER); |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 /// variables of the function signature itself when its signature is analyzed. | 503 /// variables of the function signature itself when its signature is analyzed. |
504 class FunctionSignatureBuildingScope extends TypeVariablesScope { | 504 class FunctionSignatureBuildingScope extends TypeVariablesScope { |
505 @override | 505 @override |
506 final List<ResolutionDartType> typeVariables; | 506 final List<ResolutionDartType> typeVariables; |
507 | 507 |
508 FunctionSignatureBuildingScope(Scope parent, this.typeVariables) | 508 FunctionSignatureBuildingScope(Scope parent, this.typeVariables) |
509 : super(parent); | 509 : super(parent); |
510 | 510 |
511 String toString() => 'FunctionSignatureBuildingScope($typeVariables)'; | 511 String toString() => 'FunctionSignatureBuildingScope($typeVariables)'; |
512 } | 512 } |
OLD | NEW |