| 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/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
| 10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
| (...skipping 11480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11491 } | 11491 } |
| 11492 } | 11492 } |
| 11493 | 11493 |
| 11494 @reflectiveTest | 11494 @reflectiveTest |
| 11495 class TypeOverrideManagerTest extends EngineTestCase { | 11495 class TypeOverrideManagerTest extends EngineTestCase { |
| 11496 void test_exitScope_noScopes() { | 11496 void test_exitScope_noScopes() { |
| 11497 TypeOverrideManager manager = new TypeOverrideManager(); | 11497 TypeOverrideManager manager = new TypeOverrideManager(); |
| 11498 try { | 11498 try { |
| 11499 manager.exitScope(); | 11499 manager.exitScope(); |
| 11500 fail("Expected IllegalStateException"); | 11500 fail("Expected IllegalStateException"); |
| 11501 } on IllegalStateException catch (exception) { | 11501 } on IllegalStateException { |
| 11502 // Expected | 11502 // Expected |
| 11503 } | 11503 } |
| 11504 } | 11504 } |
| 11505 | 11505 |
| 11506 void test_exitScope_oneScope() { | 11506 void test_exitScope_oneScope() { |
| 11507 TypeOverrideManager manager = new TypeOverrideManager(); | 11507 TypeOverrideManager manager = new TypeOverrideManager(); |
| 11508 manager.enterScope(); | 11508 manager.enterScope(); |
| 11509 manager.exitScope(); | 11509 manager.exitScope(); |
| 11510 try { | 11510 try { |
| 11511 manager.exitScope(); | 11511 manager.exitScope(); |
| 11512 fail("Expected IllegalStateException"); | 11512 fail("Expected IllegalStateException"); |
| 11513 } on IllegalStateException catch (exception) { | 11513 } on IllegalStateException { |
| 11514 // Expected | 11514 // Expected |
| 11515 } | 11515 } |
| 11516 } | 11516 } |
| 11517 | 11517 |
| 11518 void test_exitScope_twoScopes() { | 11518 void test_exitScope_twoScopes() { |
| 11519 TypeOverrideManager manager = new TypeOverrideManager(); | 11519 TypeOverrideManager manager = new TypeOverrideManager(); |
| 11520 manager.enterScope(); | 11520 manager.enterScope(); |
| 11521 manager.exitScope(); | 11521 manager.exitScope(); |
| 11522 manager.enterScope(); | 11522 manager.enterScope(); |
| 11523 manager.exitScope(); | 11523 manager.exitScope(); |
| 11524 try { | 11524 try { |
| 11525 manager.exitScope(); | 11525 manager.exitScope(); |
| 11526 fail("Expected IllegalStateException"); | 11526 fail("Expected IllegalStateException"); |
| 11527 } on IllegalStateException catch (exception) { | 11527 } on IllegalStateException { |
| 11528 // Expected | 11528 // Expected |
| 11529 } | 11529 } |
| 11530 } | 11530 } |
| 11531 | 11531 |
| 11532 void test_getType_enclosedOverride() { | 11532 void test_getType_enclosedOverride() { |
| 11533 TypeOverrideManager manager = new TypeOverrideManager(); | 11533 TypeOverrideManager manager = new TypeOverrideManager(); |
| 11534 LocalVariableElementImpl element = | 11534 LocalVariableElementImpl element = |
| 11535 ElementFactory.localVariableElement2("v"); | 11535 ElementFactory.localVariableElement2("v"); |
| 11536 InterfaceType type = ElementFactory.classElement2("C").type; | 11536 InterfaceType type = ElementFactory.classElement2("C").type; |
| 11537 manager.enterScope(); | 11537 manager.enterScope(); |
| (...skipping 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13688 // check propagated type | 13688 // check propagated type |
| 13689 FunctionType propagatedType = node.propagatedType as FunctionType; | 13689 FunctionType propagatedType = node.propagatedType as FunctionType; |
| 13690 expect(propagatedType.returnType, test.typeProvider.stringType); | 13690 expect(propagatedType.returnType, test.typeProvider.stringType); |
| 13691 } on AnalysisException catch (e, stackTrace) { | 13691 } on AnalysisException catch (e, stackTrace) { |
| 13692 thrownException[0] = new CaughtException(e, stackTrace); | 13692 thrownException[0] = new CaughtException(e, stackTrace); |
| 13693 } | 13693 } |
| 13694 } | 13694 } |
| 13695 return null; | 13695 return null; |
| 13696 } | 13696 } |
| 13697 } | 13697 } |
| OLD | NEW |