Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/universe/universe.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/universe/universe.dart (revision 18037) |
| +++ sdk/lib/_internal/compiler/implementation/universe/universe.dart (working copy) |
| @@ -50,7 +50,7 @@ |
| Compiler compiler) { |
| if (selectors == null) return false; |
| for (Selector selector in selectors) { |
| - if (selector.applies(member, compiler)) return true; |
| + if (selector.appliesUnnamed(member, compiler)) return true; |
| } |
| return false; |
| } |
| @@ -255,7 +255,7 @@ |
| return kind; |
| } |
| - bool applies(Element element, Compiler compiler) |
| + bool appliesUnnamed(Element element, Compiler compiler) |
| => appliesUntyped(element, compiler); |
| bool appliesUntyped(Element element, Compiler compiler) { |
| @@ -301,7 +301,23 @@ |
| } |
| } |
| + bool applies(Element element, Compiler compiler) { |
| + // TODO(ngeoffray): Remove workaround checks. |
| + if (element != compiler.assertMethod |
| + && !element.isConstructor() |
| + && name != element.name) return false; |
| + return appliesUnnamed(element, compiler); |
| + } |
| + |
| /** |
| + * Fills [list] with the arguments in a defined order. |
| + * |
| + * [compileArgument] is a function that returns a compiled version |
| + * of an argument located in [arguments]. |
| + * |
| + * [compileConstant] is a function that returns a compiled constant |
| + * of an optional argument that is not in [arguments. |
| + * |
| * Returns [:true:] if the selector and the [element] match; [:false:] |
| * otherwise. |
| * |
| @@ -447,7 +463,7 @@ |
| return false; |
| } |
| - bool applies(Element element, Compiler compiler) { |
| + bool appliesUnnamed(Element element, Compiler compiler) { |
| // [TypedSelector] are only used when compiling. |
|
kasperl
2013/02/04 13:39:03
Can we assert that the names are the same in here?
ngeoffray
2013/02/04 14:51:07
Done with a helper method sameNameHack, until we c
|
| assert(compiler.phase == Compiler.PHASE_COMPILING); |
| if (!element.isMember()) return false; |