| 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 2e98925a21c83a16ceb5894176c248d04712195d..693ec5fb5011992483b59580362fd9d60b4fb58f 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| @@ -1770,11 +1770,10 @@ abstract class BaseClassElementX extends ElementX implements ClassElement {
|
|
|
| bool get isUnnamedMixinApplication => false;
|
|
|
| - // TODO(johnniwinther): Add [thisType] getter similar to [rawType].
|
| - InterfaceType computeType(Compiler compiler) {
|
| + void computeThisAndRawType(Compiler compiler, Link<DartType> typeVariables) {
|
| if (thisType == null) {
|
| if (origin == null) {
|
| - Link<DartType> parameters = computeTypeParameters(compiler);
|
| + Link<DartType> parameters = typeVariables;
|
| thisType = new InterfaceType(this, parameters);
|
| if (parameters.isEmpty) {
|
| rawTypeCache = thisType;
|
| @@ -1791,6 +1790,13 @@ abstract class BaseClassElementX extends ElementX implements ClassElement {
|
| rawTypeCache = origin.rawType;
|
| }
|
| }
|
| + }
|
| +
|
| + // TODO(johnniwinther): Add [thisType] getter similar to [rawType].
|
| + InterfaceType computeType(Compiler compiler) {
|
| + if (thisType == null) {
|
| + computeThisAndRawType(compiler, computeTypeParameters(compiler));
|
| + }
|
| return thisType;
|
| }
|
|
|
| @@ -2296,7 +2302,11 @@ class MixinApplicationElementX extends BaseClassElementX
|
|
|
| Link<DartType> computeTypeParameters(Compiler compiler) {
|
| NamedMixinApplication named = node.asNamedMixinApplication();
|
| - if (named == null) return const Link<DartType>();
|
| + if (named == null) {
|
| + throw new SpannableAssertionFailure(node,
|
| + "Type variables on unnamed mixin applications must be set on "
|
| + "creation.");
|
| + }
|
| return TypeDeclarationElementX.createTypeVariables(
|
| this, named.typeParameters);
|
| }
|
| @@ -2377,7 +2387,7 @@ class TypeVariableElementX extends ElementX implements TypeVariableElement {
|
| TypeVariableType type;
|
| DartType bound;
|
|
|
| - TypeVariableElementX(name, Element enclosing, this.cachedNode,
|
| + TypeVariableElementX(String name, Element enclosing, this.cachedNode,
|
| [this.type, this.bound])
|
| : super(name, ElementKind.TYPE_VARIABLE, enclosing);
|
|
|
|
|