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

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

Issue 78223004: Diagnose missing @MirrorsUsed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 7 years 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: dart/sdk/lib/_internal/compiler/implementation/warnings.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/warnings.dart b/dart/sdk/lib/_internal/compiler/implementation/warnings.dart
index 1fda53e6b93618204a20d8fa6132234175f09603..dc92997d8578b51858a56a47171f6261cc4903c2 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/warnings.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/warnings.dart
@@ -1079,11 +1079,18 @@ main() => A.A = 1;
"a class.");
static const MessageKind STATIC_FUNCTION_BLOAT = const MessageKind(
- "Hint: Using '#{class}.#{name}' may result in larger output.");
+ "Hint: Using '#{class}.#{name}' may lead to unnecessarily large "
+ "generated code.",
+ howToFix:
+ "Try adding '@MirrorsUsed(...)' as described at "
+ "https://goo.gl/Akrrog.");
- static const MessageKind NON_CONST_BLOAT = const MessageKind('''
-Hint: Using "new #{name}' may result in larger output.
-Use 'const #{name}' if possible.''');
+ static const MessageKind NON_CONST_BLOAT = const MessageKind(
+ "Hint: Using 'new #{name}' may lead to unnecessarily large generated "
+ "code.",
+ howToFix:
+ "Try using 'const #{name}' or adding '@MirrorsUsed(...)' as "
+ "described at https://goo.gl/Akrrog.");
static const MessageKind STRING_EXPECTED = const MessageKind(
"Error: Expected a 'String', but got an instance of '#{type}'.");
@@ -1331,6 +1338,13 @@ main() {}
static const MessageKind MIRROR_IMPORT = const MessageKind(
"Info: Import of 'dart:mirrors'.");
+ static const MessageKind MIRROR_IMPORT_NO_USAGE = const MessageKind(
+ "Info: This import is not annotated with @MirrorsUsed, which may lead to "
+ "unnecessarily large generated code.",
+ howToFix:
+ "Try adding '@MirrorsUsed(...)' as described at "
+ "https://goo.gl/Akrrog.");
+
static const MessageKind WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT =
const MessageKind(
"Error: Argument for 'JS_INTERCEPTOR_CONSTANT' must be a type constant.");

Powered by Google App Engine
This is Rietveld 408576698