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