| 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 engine.resolver_test; | 5 library engine.resolver_test; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/context/context.dart' as newContext; | 9 import 'package:analyzer/src/context/context.dart' as newContext; |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 3073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3084 var p1 = new Point(0, 0); | 3084 var p1 = new Point(0, 0); |
| 3085 var p2 = new Point(10, 10); | 3085 var p2 = new Point(10, 10); |
| 3086 int n = p1 + p2; | 3086 int n = p1 + p2; |
| 3087 }'''); | 3087 }'''); |
| 3088 computeLibrarySourceErrors(source); | 3088 computeLibrarySourceErrors(source); |
| 3089 assertErrors(source, [HintCode.INVALID_ASSIGNMENT]); | 3089 assertErrors(source, [HintCode.INVALID_ASSIGNMENT]); |
| 3090 verify([source]); | 3090 verify([source]); |
| 3091 } | 3091 } |
| 3092 | 3092 |
| 3093 void test_isDouble() { | 3093 void test_isDouble() { |
| 3094 AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 3095 options.dart2jsHint = true; |
| 3096 resetWithOptions(options); |
| 3094 Source source = addSource("var v = 1 is double;"); | 3097 Source source = addSource("var v = 1 is double;"); |
| 3095 computeLibrarySourceErrors(source); | 3098 computeLibrarySourceErrors(source); |
| 3096 assertErrors(source, [HintCode.IS_DOUBLE]); | 3099 assertErrors(source, [HintCode.IS_DOUBLE]); |
| 3097 verify([source]); | 3100 verify([source]); |
| 3098 } | 3101 } |
| 3099 | 3102 |
| 3100 void test_isNotDouble() { | 3103 void test_isNotDouble() { |
| 3104 AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 3105 options.dart2jsHint = true; |
| 3106 resetWithOptions(options); |
| 3101 Source source = addSource("var v = 1 is! double;"); | 3107 Source source = addSource("var v = 1 is! double;"); |
| 3102 computeLibrarySourceErrors(source); | 3108 computeLibrarySourceErrors(source); |
| 3103 assertErrors(source, [HintCode.IS_NOT_DOUBLE]); | 3109 assertErrors(source, [HintCode.IS_NOT_DOUBLE]); |
| 3104 verify([source]); | 3110 verify([source]); |
| 3105 } | 3111 } |
| 3106 | 3112 |
| 3107 void test_missingReturn_async() { | 3113 void test_missingReturn_async() { |
| 3108 Source source = addSource(''' | 3114 Source source = addSource(''' |
| 3109 import 'dart:async'; | 3115 import 'dart:async'; |
| 3110 Future<int> f() async {} | 3116 Future<int> f() async {} |
| (...skipping 11207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14318 // check propagated type | 14324 // check propagated type |
| 14319 FunctionType propagatedType = node.propagatedType as FunctionType; | 14325 FunctionType propagatedType = node.propagatedType as FunctionType; |
| 14320 expect(propagatedType.returnType, test.typeProvider.stringType); | 14326 expect(propagatedType.returnType, test.typeProvider.stringType); |
| 14321 } on AnalysisException catch (e, stackTrace) { | 14327 } on AnalysisException catch (e, stackTrace) { |
| 14322 thrownException[0] = new CaughtException(e, stackTrace); | 14328 thrownException[0] = new CaughtException(e, stackTrace); |
| 14323 } | 14329 } |
| 14324 } | 14330 } |
| 14325 return null; | 14331 return null; |
| 14326 } | 14332 } |
| 14327 } | 14333 } |
| OLD | NEW |