Index: pkg/compiler/lib/src/compile_time_constants.dart |
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart |
index 724e6f669eca41b3b3742ed62d178f622b6ba15a..101d8523f48af97e253b398e87cd0437eb4c4646 100644 |
--- a/pkg/compiler/lib/src/compile_time_constants.dart |
+++ b/pkg/compiler/lib/src/compile_time_constants.dart |
@@ -238,9 +238,15 @@ abstract class ConstantCompilerBase implements ConstantCompiler { |
ConstantValue value = getConstantValue(expression); |
if (elementType.isMalformed && !value.isNull) { |
if (isConst) { |
- ErroneousElement element = elementType.element; |
- reporter.reportErrorMessage( |
- node, element.messageKind, element.messageArguments); |
+ if (elementType is MalformedType) { |
Johnni Winther
2016/05/23 12:50:41
Add a TODO for me here; I'm not sure we should gen
eernst
2016/05/23 14:30:23
Done.
|
+ ErroneousElement element = elementType.element; |
+ reporter.reportErrorMessage( |
+ node, element.messageKind, element.messageArguments); |
+ } else { |
+ assert(elementType is MethodTypeVariableType); |
+ reporter.reportErrorMessage( |
+ node, MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED); |
+ } |
} else { |
// We need to throw an exception at runtime. |
expression = null; |