Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart |
| index 9e1e01859bf7060e6ed1ec4c7da2d56d676a1fc5..ef596315f328ad6a9aaafbb125ec98075dff2f87 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart |
| @@ -1038,7 +1038,7 @@ class TypeResolver { |
| TypeResolver(this.compiler); |
| - bool anyMalformedTypesInThere(Link<DartType> list) { |
| + bool anyMalformedTypes(Link<DartType> list) { |
| for (Link<DartType> link = list; |
| !link.isEmpty; |
| link = link.tail) { |
| @@ -1136,11 +1136,24 @@ class TypeResolver { |
| // Use the canonical type if it has no type parameters. |
| type = cls.computeType(compiler); |
| } else { |
| - // In checked mode malformed-ness of the type argument bubbles up. |
| - if (anyMalformedTypesInThere(arguments) && |
| - compiler.enableTypeAssertions) { |
| - type = new MalformedType( |
| - new MalformedTypeElement(node, element)); |
| + if (anyMalformedTypes(arguments)) { |
| + // Build interface type(with malformed arguments in it) and |
| + // map it to this constructor invocation node(that's what |
|
ngeoffray
2012/11/29 09:02:26
missing space after node.
aam-me
2012/11/30 06:27:47
Done.
|
| + // whenResolved does), so that ssaBuilder visitNewSend |
|
ngeoffray
2012/11/29 09:02:26
you can write [SsaBuilder.visitNewSend]
aam-me
2012/11/30 06:27:47
Done.
|
| + // can figure out which constructor to call. |
| + type = new InterfaceType(cls.declaration, arguments); |
|
ngeoffray
2012/11/29 09:02:26
I wouldn't re-use the 'type' variable here, it mak
aam-me
2012/11/30 06:27:47
Done.
|
| + whenResolved(node, type); |
| + // However return malformed type element so that |
| + // ConstructorResolver.visitTypeAnnotation gets [:MalformedType:] |
|
ngeoffray
2012/11/29 09:02:26
[ConstructorResolver.visitTypeAnnotation]
aam-me
2012/11/30 06:27:47
Done.
|
| + // and decorates new expression with this malformed type. |
|
ngeoffray
2012/11/29 09:02:26
What means 'decorates' here?
aam-me
2012/11/30 06:27:47
I meant "maps new expression to malformed type". F
|
| + // The fact that new expression has malformed type is picked up |
| + // by ssaBuilder visitNewExpression, but doesn't affect ssaBuilder |
|
ngeoffray
2012/11/29 09:02:26
[SsaBuilder..]
aam-me
2012/11/30 06:27:47
Done.
|
| + // [:visitNewSend:] (important not to affect it in production mode) |
|
ngeoffray
2012/11/29 09:02:26
[SsaBuilder.visitNewSend].
|
| + // since it doesn't use type we create below, but follows the |
|
ngeoffray
2012/11/29 09:02:26
use the type we created below
|
| + // mapping we created above from Send node element |
|
ngeoffray
2012/11/29 09:02:26
what's 'from Send node element' ? Is that the elem
aam-me
2012/11/30 06:27:47
"Send node" is a parameter to [SsaBuilder.visitNew
|
| + // to InterfaceType. |
| + type = new MalformedType(new MalformedTypeElement(node, element)); |
| + return type; |
| } else { |
| if (arguments.isEmpty) { |
| // Use the canonical raw type if the class is generic. |