| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 analyzer.test.generated.strong_mode_test; | 5 library analyzer.test.generated.strong_mode_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 AsserterBuilder<DartType, DartType> _isType; | 55 AsserterBuilder<DartType, DartType> _isType; |
| 56 | 56 |
| 57 AsserterBuilder<Element, DartType> _hasElement; | 57 AsserterBuilder<Element, DartType> _hasElement; |
| 58 AsserterBuilder<DartType, DartType> _sameElement; | 58 AsserterBuilder<DartType, DartType> _sameElement; |
| 59 | 59 |
| 60 @override | 60 @override |
| 61 void setUp() { | 61 void setUp() { |
| 62 super.setUp(); | 62 super.setUp(); |
| 63 AnalysisOptionsImpl options = new AnalysisOptionsImpl(); | 63 AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 64 options.strongMode = true; | 64 options.strongMode = true; |
| 65 resetWithOptions(options); | 65 resetWith(options: options); |
| 66 _assertions = new TypeAssertions(typeProvider); | 66 _assertions = new TypeAssertions(typeProvider); |
| 67 _isType = _assertions.isType; | 67 _isType = _assertions.isType; |
| 68 _hasElement = _assertions.hasElement; | 68 _hasElement = _assertions.hasElement; |
| 69 _isInstantiationOf = _assertions.isInstantiationOf; | 69 _isInstantiationOf = _assertions.isInstantiationOf; |
| 70 _isInt = _assertions.isInt; | 70 _isInt = _assertions.isInt; |
| 71 _isNum = _assertions.isNum; | 71 _isNum = _assertions.isNum; |
| 72 _isString = _assertions.isString; | 72 _isString = _assertions.isString; |
| 73 _isDynamic = _assertions.isDynamic; | 73 _isDynamic = _assertions.isDynamic; |
| 74 _isListOf = _assertions.isListOf; | 74 _isListOf = _assertions.isListOf; |
| 75 _isMapOf = _assertions.isMapOf; | 75 _isMapOf = _assertions.isMapOf; |
| (...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1328 expectIdentifierType('topFunTearOffInst', "(int) → int"); | 1328 expectIdentifierType('topFunTearOffInst', "(int) → int"); |
| 1329 expectIdentifierType('topFieldTearOffInst', "(int) → int"); | 1329 expectIdentifierType('topFieldTearOffInst', "(int) → int"); |
| 1330 expectIdentifierType('localTearOffInst', "(int) → int"); | 1330 expectIdentifierType('localTearOffInst', "(int) → int"); |
| 1331 expectIdentifierType('paramTearOffInst', "(int) → int"); | 1331 expectIdentifierType('paramTearOffInst', "(int) → int"); |
| 1332 } | 1332 } |
| 1333 | 1333 |
| 1334 void setUp() { | 1334 void setUp() { |
| 1335 super.setUp(); | 1335 super.setUp(); |
| 1336 AnalysisOptionsImpl options = new AnalysisOptionsImpl(); | 1336 AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1337 options.strongMode = true; | 1337 options.strongMode = true; |
| 1338 resetWithOptions(options); | 1338 resetWith(options: options); |
| 1339 } | 1339 } |
| 1340 | 1340 |
| 1341 test_dynamicObjectGetter_hashCode() async { | 1341 test_dynamicObjectGetter_hashCode() async { |
| 1342 String code = r''' | 1342 String code = r''' |
| 1343 main() { | 1343 main() { |
| 1344 dynamic a = null; | 1344 dynamic a = null; |
| 1345 var foo = a.hashCode; | 1345 var foo = a.hashCode; |
| 1346 } | 1346 } |
| 1347 '''; | 1347 '''; |
| 1348 await resolveTestUnit(code); | 1348 await resolveTestUnit(code); |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2173 } | 2173 } |
| 2174 } | 2174 } |
| 2175 | 2175 |
| 2176 @reflectiveTest | 2176 @reflectiveTest |
| 2177 class StrongModeTypePropagationTest extends ResolverTestCase { | 2177 class StrongModeTypePropagationTest extends ResolverTestCase { |
| 2178 @override | 2178 @override |
| 2179 void setUp() { | 2179 void setUp() { |
| 2180 super.setUp(); | 2180 super.setUp(); |
| 2181 AnalysisOptionsImpl options = new AnalysisOptionsImpl(); | 2181 AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 2182 options.strongMode = true; | 2182 options.strongMode = true; |
| 2183 resetWithOptions(options); | 2183 resetWith(options: options); |
| 2184 } | 2184 } |
| 2185 | 2185 |
| 2186 test_foreachInference_dynamic_disabled() async { | 2186 test_foreachInference_dynamic_disabled() async { |
| 2187 String code = r''' | 2187 String code = r''' |
| 2188 main() { | 2188 main() { |
| 2189 var list = <int>[]; | 2189 var list = <int>[]; |
| 2190 for (dynamic v in list) { | 2190 for (dynamic v in list) { |
| 2191 v; // marker | 2191 v; // marker |
| 2192 } | 2192 } |
| 2193 }'''; | 2193 }'''; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2420 await assertTypeOfMarkedExpression(code, typeProvider.intType, null); | 2420 await assertTypeOfMarkedExpression(code, typeProvider.intType, null); |
| 2421 } | 2421 } |
| 2422 } | 2422 } |
| 2423 | 2423 |
| 2424 @reflectiveTest | 2424 @reflectiveTest |
| 2425 class StrongModeTypePropagationTest_Driver | 2425 class StrongModeTypePropagationTest_Driver |
| 2426 extends StrongModeTypePropagationTest { | 2426 extends StrongModeTypePropagationTest { |
| 2427 @override | 2427 @override |
| 2428 bool get enableNewAnalysisDriver => true; | 2428 bool get enableNewAnalysisDriver => true; |
| 2429 } | 2429 } |
| OLD | NEW |