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

Unified Diff: pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart

Issue 1706033002: More shared messages. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/diagnostics/generated/shared_messages.dart
diff --git a/pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart b/pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart
index e39c8db85f77f4eb9604c09eb4d0d955bd10921e..7419ab2f379e30a3351bf46af280480c65b18f69 100644
--- a/pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart
@@ -73,4 +73,34 @@ const Map<MessageKind, MessageTemplate> TEMPLATES = const <MessageKind, MessageT
"class A { int A() {} } main() { new A(); }",
]
), // Generated. Don't edit.
+ MessageKind.RETURN_IN_GENERATIVE_CONSTRUCTOR: const MessageTemplate(
+ MessageKind.RETURN_IN_GENERATIVE_CONSTRUCTOR,
+ "Constructors can't return values.",
+ howToFix: "Try removing the return statement or using a factory constructor.",
+ examples: const [
+ r"""
+ class C {
+ C() {
+ return 1;
+ }
+ }
+
+ main() => new C();""",
+ ]
+ ), // Generated. Don't edit.
+ MessageKind.RETURN_IN_GENERATOR: const MessageTemplate(
+ MessageKind.RETURN_IN_GENERATOR,
+ "Can't return a value from a generator function (using the '#{modifier}' modifier).",
+ howToFix: "Try removing the value, replacing 'return' with 'yield' or changing the method body modifier",
+ examples: const [
+ r"""
+ foo() async* { return 0; }
+ main() => foo();
+ """,
+ r"""
+ foo() sync* { return 0; }
+ main() => foo();
+ """,
+ ]
+ ), // Generated. Don't edit.
};
« no previous file with comments | « pkg/analyzer/lib/src/generated/generated/shared_messages.dart ('k') | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698