| 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 library kernel.transformations.mixin_full_resolution; | 4 library kernel.transformations.mixin_full_resolution; |
| 5 | 5 |
| 6 import '../ast.dart'; | 6 import '../ast.dart'; |
| 7 import '../class_hierarchy.dart'; | 7 import '../class_hierarchy.dart'; |
| 8 import '../clone.dart'; | 8 import '../clone.dart'; |
| 9 import '../core_types.dart'; | 9 import '../core_types.dart'; |
| 10 import '../target/targets.dart' show Target; | 10 import '../target/targets.dart' show Target; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // the mixin and constructors from the base class. | 46 // the mixin and constructors from the base class. |
| 47 var processedClasses = new Set<Class>(); | 47 var processedClasses = new Set<Class>(); |
| 48 for (var library in libraries) { | 48 for (var library in libraries) { |
| 49 if (library.isExternal) continue; | 49 if (library.isExternal) continue; |
| 50 | 50 |
| 51 for (var class_ in library.classes) { | 51 for (var class_ in library.classes) { |
| 52 transformClass(libraries, processedClasses, transformedClasses, class_); | 52 transformClass(libraries, processedClasses, transformedClasses, class_); |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 | 55 |
| 56 // If there are transformed classes, we need to update hierarchy. | 56 // We might need to update the class hierarchy. |
| 57 if (transformedClasses.isNotEmpty) { | 57 hierarchy = hierarchy.applyChanges(transformedClasses); |
| 58 var program = libraries.first.enclosingProgram; | |
| 59 hierarchy = new ClosedWorldClassHierarchy(program); | |
| 60 } | |
| 61 | 58 |
| 62 // Resolve all super call expressions and super initializers. | 59 // Resolve all super call expressions and super initializers. |
| 63 for (var library in libraries) { | 60 for (var library in libraries) { |
| 64 if (library.isExternal) continue; | 61 if (library.isExternal) continue; |
| 65 | 62 |
| 66 for (var class_ in library.classes) { | 63 for (var class_ in library.classes) { |
| 67 final bool hasTransformedSuperclass = | 64 final bool hasTransformedSuperclass = |
| 68 transformedClasses.contains(class_.superclass); | 65 transformedClasses.contains(class_.superclass); |
| 69 | 66 |
| 70 for (var procedure in class_.procedures) { | 67 for (var procedure in class_.procedures) { |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 return null; | 341 return null; |
| 345 } | 342 } |
| 346 } | 343 } |
| 347 | 344 |
| 348 throw new Exception( | 345 throw new Exception( |
| 349 'Could not find a generative constructor named "${constructor.name}" ' | 346 'Could not find a generative constructor named "${constructor.name}" ' |
| 350 'in lookup class "${lookupClass.name}"!'); | 347 'in lookup class "${lookupClass.name}"!'); |
| 351 } | 348 } |
| 352 } | 349 } |
| 353 } | 350 } |
| OLD | NEW |