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

Unified Diff: pkg/compiler/lib/src/warnings.dart

Issue 1023673012: Emit diagnostics for bad NSM implementations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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: pkg/compiler/lib/src/warnings.dart
diff --git a/pkg/compiler/lib/src/warnings.dart b/pkg/compiler/lib/src/warnings.dart
index 40b04edb23a94edbf4266ccc50ac1b6eb3ef48bd..f9bff05aadcb483a893524a3ca46ff85a45f23cf 100644
--- a/pkg/compiler/lib/src/warnings.dart
+++ b/pkg/compiler/lib/src/warnings.dart
@@ -2410,6 +2410,28 @@ $IMPORT_EXPERIMENTAL_MIRRORS_PADDING#{importChain}
"Non-supported 'call' member on a native class, or a "
"subclass of a native class.");
+ static const MessageKind DIRECTLY_THROWING_NSM =
+ const MessageKind(
+ "This 'noSuchMethod' implementation is guaranteed to throw an "
+ "exception. The generated code will be smaller if it is "
+ "rewritten.",
+ howToFix: "Rewrite to "
+ "'noSuchMethod(Invocation i) => super.noSuchMethod(i)'.");
sra1 2015/03/31 02:19:14 Missing semicolon in rewrite text
+
+ static const MessageKind COMPLEX_THROWING_NSM =
+ const MessageKind(
+ "This 'noSuchMethod' implementation is guaranteed to throw an "
+ "exception. The generated code will be smaller and the compiler "
+ "will be able to perform more optimizations if it is rewritten.",
+ howToFix: "Rewrite to "
+ "'noSuchMethod(Invocation i) => super.noSuchMethod(i)'.");
+
+ static const MessageKind COMPLEX_RETURNING_NSM =
+ const MessageKind(
+ "Overriding 'noSuchMethod' causes the compiler to generate "
+ "more code and prevents the compiler from doing some optimizations.",
+ howToFix: "Consider removing this 'noSuchMethod' implementation.");
+
toString() => template;
Message message([Map arguments = const {}, bool terse = false]) {

Powered by Google App Engine
This is Rietveld 408576698