| 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 '../dart_types.dart'; | 9 import '../dart_types.dart'; |
| 10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 // Use async marker to determine the return type of function | 382 // Use async marker to determine the return type of function |
| 383 // expressions. | 383 // expressions. |
| 384 FunctionElement function = element; | 384 FunctionElement function = element; |
| 385 asyncMarker = function.asyncMarker; | 385 asyncMarker = function.asyncMarker; |
| 386 } | 386 } |
| 387 switch (asyncMarker) { | 387 switch (asyncMarker) { |
| 388 case AsyncMarker.SYNC: | 388 case AsyncMarker.SYNC: |
| 389 returnType = visitor.resolveReturnType(returnNode); | 389 returnType = visitor.resolveReturnType(returnNode); |
| 390 break; | 390 break; |
| 391 case AsyncMarker.SYNC_STAR: | 391 case AsyncMarker.SYNC_STAR: |
| 392 returnType = resolution.coreTypes.iterableType(); | 392 returnType = resolution.commonElements.iterableType(); |
| 393 break; | 393 break; |
| 394 case AsyncMarker.ASYNC: | 394 case AsyncMarker.ASYNC: |
| 395 returnType = resolution.coreTypes.futureType(); | 395 returnType = resolution.commonElements.futureType(); |
| 396 break; | 396 break; |
| 397 case AsyncMarker.ASYNC_STAR: | 397 case AsyncMarker.ASYNC_STAR: |
| 398 returnType = resolution.coreTypes.streamType(); | 398 returnType = resolution.commonElements.streamType(); |
| 399 break; | 399 break; |
| 400 } | 400 } |
| 401 } | 401 } |
| 402 | 402 |
| 403 if (element.isSetter && | 403 if (element.isSetter && |
| 404 (requiredParameterCount != 1 || visitor.optionalParameterCount != 0)) { | 404 (requiredParameterCount != 1 || visitor.optionalParameterCount != 0)) { |
| 405 // If there are no formal parameters, we already reported an error above. | 405 // If there are no formal parameters, we already reported an error above. |
| 406 if (formalParameters != null) { | 406 if (formalParameters != null) { |
| 407 reporter.reportErrorMessage( | 407 reporter.reportErrorMessage( |
| 408 formalParameters, MessageKind.ILLEGAL_SETTER_FORMALS); | 408 formalParameters, MessageKind.ILLEGAL_SETTER_FORMALS); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 /// variables of the function signature itself when its signature is analyzed. | 482 /// variables of the function signature itself when its signature is analyzed. |
| 483 class FunctionSignatureBuildingScope extends TypeVariablesScope { | 483 class FunctionSignatureBuildingScope extends TypeVariablesScope { |
| 484 @override | 484 @override |
| 485 final List<DartType> typeVariables; | 485 final List<DartType> typeVariables; |
| 486 | 486 |
| 487 FunctionSignatureBuildingScope(Scope parent, this.typeVariables) | 487 FunctionSignatureBuildingScope(Scope parent, this.typeVariables) |
| 488 : super(parent); | 488 : super(parent); |
| 489 | 489 |
| 490 String toString() => 'FunctionSignatureBuildingScope($typeVariables)'; | 490 String toString() => 'FunctionSignatureBuildingScope($typeVariables)'; |
| 491 } | 491 } |
| OLD | NEW |