Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: pkg/compiler/lib/src/diagnostics/messages.dart

Issue 2001393003: Revision of "Adjusts dart2js backend to handle method type arguments" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/dart_types.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..830a010ad396a68d44db01c3a90f7fa02f092978 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,38 @@ 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."
+// TODO(eernst): These examples should be commented in with an `options:`
+// specifying "--generic-method-syntax" and made to work; moreover, the
+// compiler/dart2js test 'generic_method_type_usage' should be transformed to
+// similar examples of the relevant `MessageKind` entries.
+//
+// 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 "
« no previous file with comments | « pkg/compiler/lib/src/dart_types.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698