Chromium Code Reviews| Index: pkg/compiler/lib/src/diagnostics/messages.dart |
| diff --git a/pkg/compiler/lib/src/diagnostics/messages.dart b/pkg/compiler/lib/src/diagnostics/messages.dart |
| index bbe777e09c6d537b8596815b896b5499d80e37ce..4baa88972f6daf7aa7fa53a0cdeeb275eb87c8c3 100644 |
| --- a/pkg/compiler/lib/src/diagnostics/messages.dart |
| +++ b/pkg/compiler/lib/src/diagnostics/messages.dart |
| @@ -430,6 +430,7 @@ enum MessageKind { |
| TYPE_ARGUMENT_COUNT_MISMATCH, |
| TYPE_VARIABLE_IN_CONSTANT, |
| TYPE_VARIABLE_WITHIN_STATIC_MEMBER, |
| + TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED, |
| TYPEDEF_FORMAL_WITH_DEFAULT, |
| UNARY_OPERATOR_BAD_ARITY, |
| UNBOUND_LABEL, |
| @@ -1152,6 +1153,36 @@ void main() => new C().m(null); |
| """ |
| ]), |
| + MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED: const MessageTemplate( |
| + MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED, |
| + "Method type variables are not reified.", |
| + howToFix: "Try using the intended upper bound of the " |
| + "type variable, or dynamic." |
|
Johnni Winther
2016/05/23 12:50:41
You can add an [options] argument to MessageTempla
eernst
2016/05/23 14:30:24
Marked as TODOs for the next CL.
|
| +// GENERIC_METHODS: These examples can be commented in when the compiler |
| +// supports generic methods without an option: |
| +// |
| +// examples: const [ |
| +// """ |
| +// // Method type variables are not reified, so they cannot be returned. |
| +// Type f<T>() => T; |
| +// |
| +// main() => f<int>(); |
| +// """, |
| +// """ |
| +// // Method type variables are not reified, so they cannot be tested dynamically. |
| +// bool f<T>(Object o) => o is T; |
| +// |
| +// main() => f<int>(42); |
| +// """, |
| +// """ |
| +// // Method type variables are not reified, so they cannot be tested dynamically. |
| +// bool f<T>(Object o) => o as T; |
| +// |
| +// main() => f<int>(42); |
| +// """ |
| +// ] |
| + ), |
| + |
| MessageKind.INVALID_TYPE_VARIABLE_BOUND: const MessageTemplate( |
| MessageKind.INVALID_TYPE_VARIABLE_BOUND, |
| "'#{typeArgument}' is not a subtype of bound '#{bound}' for " |