OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // TODO(jmesserly): this file needs to be refactored, it's a port from | 5 // TODO(jmesserly): this file needs to be refactored, it's a port from |
6 // package:dev_compiler's tests | 6 // package:dev_compiler's tests |
7 /// Tests for type inference. | 7 /// Tests for type inference. |
8 library analyzer.test.src.task.strong.inferred_type_test; | 8 library analyzer.test.src.task.strong.inferred_type_test; |
9 | 9 |
10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
(...skipping 4254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4265 class A<T extends int> {} | 4265 class A<T extends int> {} |
4266 class B<T extends /*error:NOT_INSTANTIATED_BOUND*/A> {} | 4266 class B<T extends /*error:NOT_INSTANTIATED_BOUND*/A> {} |
4267 B v = null; | 4267 B v = null; |
4268 '''); | 4268 '''); |
4269 expect(unit.topLevelVariables[0].type.toString(), 'B<A<dynamic>>'); | 4269 expect(unit.topLevelVariables[0].type.toString(), 'B<A<dynamic>>'); |
4270 } | 4270 } |
4271 | 4271 |
4272 void test_instantiateToBounds_generic2_noBound() { | 4272 void test_instantiateToBounds_generic2_noBound() { |
4273 var unit = checkFile(r''' | 4273 var unit = checkFile(r''' |
4274 class A<T> {} | 4274 class A<T> {} |
4275 class B<T extends /*error:NOT_INSTANTIATED_BOUND*/A> {} | 4275 class B<T extends A> {} |
4276 B v = null; | 4276 B v = null; |
4277 '''); | 4277 '''); |
4278 expect(unit.topLevelVariables[0].type.toString(), 'B<A<dynamic>>'); | 4278 expect(unit.topLevelVariables[0].type.toString(), 'B<A<dynamic>>'); |
4279 } | 4279 } |
4280 | 4280 |
4281 void test_instantiateToBounds_generic_hasBound_definedAfter() { | 4281 void test_instantiateToBounds_generic_hasBound_definedAfter() { |
4282 var unit = checkFile(r''' | 4282 var unit = checkFile(r''' |
4283 A v = null; | 4283 A v = null; |
4284 class A<T extends int> {} | 4284 class A<T extends int> {} |
4285 '''); | 4285 '''); |
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5380 } | 5380 } |
5381 | 5381 |
5382 void setUp() { | 5382 void setUp() { |
5383 helper.doSetUp(); | 5383 helper.doSetUp(); |
5384 } | 5384 } |
5385 | 5385 |
5386 void tearDown() { | 5386 void tearDown() { |
5387 helper.doTearDown(); | 5387 helper.doTearDown(); |
5388 } | 5388 } |
5389 } | 5389 } |
OLD | NEW |