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

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: Handle mixins, too. And fix bugs with mixins. 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..ff89fc719ea085c465ef251aaa9175575114963b 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: Class can't extend malformed type.",
Johnni Winther 2013/10/16 12:22:23 'A class ... a malformed type' seems less harsh.
karlklose 2013/10/16 12:34:51 Done.
+ 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: Class can't implement malformed type.",
Johnni Winther 2013/10/16 12:22:23 Ditto.
karlklose 2013/10/16 12:34:51 Done.
+ 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: Class can't mixin malformed type.",
Johnni Winther 2013/10/16 12:22:23 Ditto.
karlklose 2013/10/16 12:34:51 Done.
+ 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.",

Powered by Google App Engine
This is Rietveld 408576698