| Index: sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| index 0d784568cd6b717a9b2c77eb9a97cb945327d2e3..fcd8691ac586a17276ae5af2052bf9f54e3e0e83 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| @@ -176,8 +176,13 @@ class ElementX implements Element {
|
| Token position() => null;
|
|
|
| Token findMyName(Token token) {
|
| - for (Token t = token; !identical(t.kind, EOF_TOKEN); t = t.next) {
|
| - if (t.value == name) return t;
|
| + // We search for the token that has the name of this element.
|
| + // For constructors, that doesn't work because they may have
|
| + // named formed out of multiple tokens (named constructors) so
|
| + // for those we search for the class name instead.
|
| + String needle = isConstructor() ? enclosingElement.name : name;
|
| + for (Token t = token; EOF_TOKEN != t.kind; t = t.next) {
|
| + if (needle == t.value) return t;
|
| }
|
| return token;
|
| }
|
|
|