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

Side by Side Diff: pkg/compiler/lib/src/diagnostics/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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 5
6 /** 6 /**
7 * The messages in this file should meet the following guide lines: 7 * The messages in this file should meet the following guide lines:
8 * 8 *
9 * 1. The message should be a complete sentence starting with an uppercase 9 * 1. The message should be a complete sentence starting with an uppercase
10 * letter, and ending with a period. 10 * letter, and ending with a period.
(...skipping 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after
1840 "Operator '#{operatorName}' must have exactly 2 parameters."), 1840 "Operator '#{operatorName}' must have exactly 2 parameters."),
1841 1841
1842 MessageKind.OPERATOR_OPTIONAL_PARAMETERS: 1842 MessageKind.OPERATOR_OPTIONAL_PARAMETERS:
1843 const MessageTemplate(MessageKind.OPERATOR_OPTIONAL_PARAMETERS, 1843 const MessageTemplate(MessageKind.OPERATOR_OPTIONAL_PARAMETERS,
1844 "Operator '#{operatorName}' cannot have optional parameters."), 1844 "Operator '#{operatorName}' cannot have optional parameters."),
1845 1845
1846 MessageKind.OPERATOR_NAMED_PARAMETERS: 1846 MessageKind.OPERATOR_NAMED_PARAMETERS:
1847 const MessageTemplate(MessageKind.OPERATOR_NAMED_PARAMETERS, 1847 const MessageTemplate(MessageKind.OPERATOR_NAMED_PARAMETERS,
1848 "Operator '#{operatorName}' cannot have named parameters."), 1848 "Operator '#{operatorName}' cannot have named parameters."),
1849 1849
1850 MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE:
1851 const MessageTemplate(MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE,
1852 "Cannot have return type for constructor."),
1853
1854 MessageKind.CANNOT_RETURN_FROM_CONSTRUCTOR: 1850 MessageKind.CANNOT_RETURN_FROM_CONSTRUCTOR:
1855 const MessageTemplate(MessageKind.CANNOT_RETURN_FROM_CONSTRUCTOR, 1851 const MessageTemplate(MessageKind.CANNOT_RETURN_FROM_CONSTRUCTOR,
1856 "Constructors can't return values.", 1852 "Constructors can't return values.",
1857 howToFix: "Remove the return statement or use a factory constructor.", 1853 howToFix: "Remove the return statement or use a factory constructor.",
1858 examples: const [""" 1854 examples: const ["""
1859 class C { 1855 class C {
1860 C() { 1856 C() {
1861 return 1; 1857 return 1;
1862 } 1858 }
1863 } 1859 }
(...skipping 1844 matching lines...) Expand 10 before | Expand all | Expand 10 after
3708 static String convertToString(value) { 3704 static String convertToString(value) {
3709 if (value is ErrorToken) { 3705 if (value is ErrorToken) {
3710 // Shouldn't happen. 3706 // Shouldn't happen.
3711 return value.assertionMessage; 3707 return value.assertionMessage;
3712 } else if (value is Token) { 3708 } else if (value is Token) {
3713 value = value.value; 3709 value = value.value;
3714 } 3710 }
3715 return '$value'; 3711 return '$value';
3716 } 3712 }
3717 } 3713 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart ('k') | pkg/dart_messages/lib/generated/shared_messages.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698