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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart

Issue 2970273004: Deprecate all diagnostics methods that use strings. (Closed)
Patch Set: Merged with 4df146dd9a465d63344330bf3e45524b927c92ec Created 3 years, 5 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/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart
index b00f560acfedbc7147ea140213b27ccb205f9809..515c1ed73b227e25cfc03b638707a5e70d77c5b1 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_enum_builder.dart
@@ -157,12 +157,13 @@ class KernelEnumBuilder extends SourceClassBuilder
String name = constantNamesAndOffsets[i];
int charOffset = constantNamesAndOffsets[i + 1];
if (members.containsKey(name)) {
- parent.addCompileTimeError(charOffset, "Duplicated name: '$name'.");
+ parent.deprecated_addCompileTimeError(
+ charOffset, "Duplicated name: '$name'.");
constantNamesAndOffsets[i] = null;
continue;
}
if (name == className) {
- parent.addCompileTimeError(
+ parent.deprecated_addCompileTimeError(
charOffset,
"Name of enum constant '$name' can't be the same as the enum's "
"own name.");
@@ -213,7 +214,7 @@ class KernelEnumBuilder extends SourceClassBuilder
@override
Class build(KernelLibraryBuilder libraryBuilder, LibraryBuilder coreLibrary) {
if (constantNamesAndOffsets.isEmpty) {
- libraryBuilder.addCompileTimeError(
+ libraryBuilder.deprecated_addCompileTimeError(
-1, "An enum declaration can't be empty.");
}
intType.resolveIn(coreLibrary.scope);
@@ -258,7 +259,8 @@ class KernelEnumBuilder extends SourceClassBuilder
// unnamed constructor requires no arguments. But that information isn't
// always available at this point, and it's not really a situation that
// can happen unless you start modifying the SDK sources.
- addCompileTimeError(-1, "'Object' has no unnamed constructor.");
+ deprecated_addCompileTimeError(
+ -1, "'Object' has no unnamed constructor.");
} else {
constructor.initializers.add(
new SuperInitializer(superConstructor.target, new Arguments.empty())

Powered by Google App Engine
This is Rietveld 408576698