| Index: pkg/compiler/lib/src/resolution/type_resolver.dart
|
| diff --git a/pkg/compiler/lib/src/resolution/type_resolver.dart b/pkg/compiler/lib/src/resolution/type_resolver.dart
|
| index 832279bdb0938e2a3aa871d516e92dd43510e521..101d2e889f47b92803309c496202086de7e8dbe6 100644
|
| --- a/pkg/compiler/lib/src/resolution/type_resolver.dart
|
| +++ b/pkg/compiler/lib/src/resolution/type_resolver.dart
|
| @@ -18,6 +18,7 @@ import '../elements/elements.dart'
|
| ErroneousElement,
|
| PrefixElement,
|
| TypedefElement,
|
| + TypeDeclarationElement,
|
| TypeVariableElement;
|
| import '../elements/modelx.dart' show ErroneousElementX;
|
| import '../tree/tree.dart';
|
| @@ -205,12 +206,17 @@ class TypeResolver {
|
| }
|
| }
|
| } else if (element.isTypeVariable) {
|
| + // FIXME: check enclosing, which may be not class, not typedef (so
|
| + // it's a generic method) then set the type to `const DynamicType()`.
|
| + // This should later be fixed such that we don't tell the user that they
|
| + // wrote `dynamic` anywhere.
|
| TypeVariableElement typeVariable = element;
|
| Element outer =
|
| visitor.enclosingElement.outermostEnclosingMemberOrTopLevel;
|
| if (!outer.isClass &&
|
| !outer.isTypedef &&
|
| - !Elements.hasAccessToTypeVariables(visitor.enclosingElement)) {
|
| + !Elements.hasAccessToTypeVariables(visitor.enclosingElement) &&
|
| + typeVariable.typeDeclaration is TypeDeclarationElement) {
|
| registry.registerFeature(Feature.THROW_RUNTIME_ERROR);
|
| type = reportFailureAndCreateType(
|
| MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
|
|
|