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 library related_types; | 5 library related_types; |
6 | 6 |
7 import 'package:compiler/src/commandline_options.dart'; | 7 import 'package:compiler/src/commandline_options.dart'; |
8 import 'package:compiler/src/compiler.dart'; | 8 import 'package:compiler/src/compiler.dart'; |
9 import 'package:compiler/src/core_types.dart'; | 9 import 'package:compiler/src/core_types.dart'; |
10 import 'package:compiler/src/dart_types.dart'; | 10 import 'package:compiler/src/dart_types.dart'; |
(...skipping 17 matching lines...) Expand all Loading... |
28 if (result.isSuccess) { | 28 if (result.isSuccess) { |
29 checkRelatedTypes(result.compiler); | 29 checkRelatedTypes(result.compiler); |
30 } | 30 } |
31 } else { | 31 } else { |
32 print('Usage dart related_types.dart <entry-point>'); | 32 print('Usage dart related_types.dart <entry-point>'); |
33 } | 33 } |
34 } | 34 } |
35 | 35 |
36 /// Check all loaded libraries in [compiler] for unrelated types. | 36 /// Check all loaded libraries in [compiler] for unrelated types. |
37 void checkRelatedTypes(Compiler compiler) { | 37 void checkRelatedTypes(Compiler compiler) { |
38 compiler.openWorld.closeWorld(compiler.reporter); | 38 compiler.closeResolution(); |
| 39 compiler.closedWorld; |
39 for (LibraryElement library in compiler.libraryLoader.libraries) { | 40 for (LibraryElement library in compiler.libraryLoader.libraries) { |
40 checkLibraryElement(compiler, library); | 41 checkLibraryElement(compiler, library); |
41 } | 42 } |
42 } | 43 } |
43 | 44 |
44 /// Check [library] for unrelated types. | 45 /// Check [library] for unrelated types. |
45 void checkLibraryElement(Compiler compiler, LibraryElement library) { | 46 void checkLibraryElement(Compiler compiler, LibraryElement library) { |
46 library.forEachLocalMember((Element element) { | 47 library.forEachLocalMember((Element element) { |
47 if (element.isClass) { | 48 if (element.isClass) { |
48 ClassElement cls = element; | 49 ClassElement cls = element; |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 ClassElement findClass(DartType type) => type.accept(this, null); | 412 ClassElement findClass(DartType type) => type.accept(this, null); |
412 | 413 |
413 @override | 414 @override |
414 ClassElement visitType(DartType type, _) => null; | 415 ClassElement visitType(DartType type, _) => null; |
415 | 416 |
416 @override | 417 @override |
417 ClassElement visitInterfaceType(InterfaceType type, _) { | 418 ClassElement visitInterfaceType(InterfaceType type, _) { |
418 return type.element; | 419 return type.element; |
419 } | 420 } |
420 } | 421 } |
OLD | NEW |