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

Unified Diff: sdk/lib/_internal/compiler/implementation/warnings.dart

Issue 27494002: Report compile-time error when extending, mixing in or implementing a malformed type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 2 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
Index: sdk/lib/_internal/compiler/implementation/warnings.dart
diff --git a/sdk/lib/_internal/compiler/implementation/warnings.dart b/sdk/lib/_internal/compiler/implementation/warnings.dart
index 33907ca9cb27f6fd0902e0fd69e6315920ce096d..6bde7b8d7c60d9614ba73dbad8d0f9cd2fe9d74f 100644
--- a/sdk/lib/_internal/compiler/implementation/warnings.dart
+++ b/sdk/lib/_internal/compiler/implementation/warnings.dart
@@ -713,6 +713,30 @@ main() { F f = null; }"""]);
static const MessageKind CANNOT_IMPLEMENT = const MessageKind(
"Error: '#{type}' cannot be implemented.");
+ static const MessageKind CANNOT_EXTEND_MALFORMED = const MessageKind(
+ "Error: A class can't extend a malformed type.",
+ howToFix: "Try correcting the malformed type annotation or removing the "
+ "'extends' clause.",
+ examples: const ["""
+class A extends Malformed {}
+main() => new A();"""]);
+
+ static const MessageKind CANNOT_IMPLEMENT_MALFORMED = const MessageKind(
+ "Error: A class can't implement a malformed type.",
+ howToFix: "Try correcting the malformed type annotation or removing the "
+ "type from the 'implements' clause.",
+ examples: const ["""
+class A implements Malformed {}
+main() => new A();"""]);
+
+ static const MessageKind CANNOT_MIXIN_MALFORMED = const MessageKind(
+ "Error: A class can't mixin a malformed type.",
+ howToFix: "Try correcting the malformed type annotation or removing the "
+ "type from the 'with' clause.",
+ examples: const ["""
+class A extends Object with Malformed {}
+main() => new A();"""]);
+
static const MessageKind CANNOT_MIXIN = const MessageKind(
"Error: The type '#{type}' can't be mixed in.",
howToFix: "Try removing '#{type}' from the 'with' clause.",
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/members.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698