| 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/common_elements.dart'; | 9 import 'package:compiler/src/common_elements.dart'; |
| 10 import 'package:compiler/src/elements/resolution_types.dart'; | 10 import 'package:compiler/src/elements/resolution_types.dart'; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 for (LibraryElement library in compiler.libraryLoader.libraries) { | 40 for (LibraryElement library in compiler.libraryLoader.libraries) { |
| 41 checkLibraryElement(compiler, library); | 41 checkLibraryElement(compiler, library); |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 /// Check [library] for unrelated types. | 45 /// Check [library] for unrelated types. |
| 46 void checkLibraryElement(Compiler compiler, LibraryElement library) { | 46 void checkLibraryElement(Compiler compiler, LibraryElement library) { |
| 47 library.forEachLocalMember((Element element) { | 47 library.forEachLocalMember((Element element) { |
| 48 if (element.isClass) { | 48 if (element.isClass) { |
| 49 ClassElement cls = element; | 49 ClassElement cls = element; |
| 50 cls.forEachLocalMember((MemberElement member) { | 50 cls.forEachLocalMember((_member) { |
| 51 MemberElement member = _member; |
| 51 checkMemberElement(compiler, member); | 52 checkMemberElement(compiler, member); |
| 52 }); | 53 }); |
| 53 } else if (!element.isTypedef) { | 54 } else if (!element.isTypedef) { |
| 54 checkMemberElement(compiler, element); | 55 checkMemberElement(compiler, element); |
| 55 } | 56 } |
| 56 }); | 57 }); |
| 57 } | 58 } |
| 58 | 59 |
| 59 /// Check [member] for unrelated types. | 60 /// Check [member] for unrelated types. |
| 60 void checkMemberElement(Compiler compiler, MemberElement member) { | 61 void checkMemberElement(Compiler compiler, MemberElement member) { |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 ClassElement findClass(ResolutionDartType type) => type.accept(this, null); | 431 ClassElement findClass(ResolutionDartType type) => type.accept(this, null); |
| 431 | 432 |
| 432 @override | 433 @override |
| 433 ClassElement visitType(ResolutionDartType type, _) => null; | 434 ClassElement visitType(ResolutionDartType type, _) => null; |
| 434 | 435 |
| 435 @override | 436 @override |
| 436 ClassElement visitInterfaceType(ResolutionInterfaceType type, _) { | 437 ClassElement visitInterfaceType(ResolutionInterfaceType type, _) { |
| 437 return type.element; | 438 return type.element; |
| 438 } | 439 } |
| 439 } | 440 } |
| OLD | NEW |