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

Unified Diff: pkg/dart_messages/lib/shared_messages.dart

Issue 1704173002: Use shared error for constructor's with return type. (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
« no previous file with comments | « pkg/dart_messages/lib/generated/shared_messages.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dart_messages/lib/shared_messages.dart
diff --git a/pkg/dart_messages/lib/shared_messages.dart b/pkg/dart_messages/lib/shared_messages.dart
index 6c2ff2251791d3008ad5b5140ddcb7e8a6daf812..ea556ba2b8036e4e48138bd28875526c459d7581 100644
--- a/pkg/dart_messages/lib/shared_messages.dart
+++ b/pkg/dart_messages/lib/shared_messages.dart
@@ -385,18 +385,20 @@ final Map<String, Message> MESSAGES = {
]),
'CLASS_IN_CLASS': new Message(
+ // Dart2js currently reports this as an EXTRANEOUS_MODIFIER error.
+ // TODO(floitsch): make dart2js use this error instead.
id: 'DOTHQH',
category: Category.parserError,
template: "Classes can't be declared inside other classes.",
howToFix: "Try moving the class to the top-level.",
usedBy: [analyzer],
- examples: const ["class A { class B {} } main() {}",]),
+ examples: const ["class A { class B {} } main() { new A(); }",]),
'CONSTRUCTOR_WITH_RETURN_TYPE': new Message(
id: 'VOJBWY',
category: Category.parserError,
template: "Constructors can't have a return type",
howToFix: "Try removing the return type.",
- usedBy: [analyzer],
- examples: const ["class A { int A() {} } main() {}",]),
+ usedBy: [analyzer, dart2js],
+ examples: const ["class A { int A() {} } main() { new A(); }",]),
};
« no previous file with comments | « pkg/dart_messages/lib/generated/shared_messages.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698