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

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

Issue 2976753002: Remove deprecated_addNit. (Closed)
Patch Set: 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_library_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
index 3e514e21b4c2e69e54a22c3a63f10b2e38d80743..9a6a89462099e3349a7f997630a50bc17314a1e7 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
@@ -10,6 +10,16 @@ import 'package:kernel/clone.dart' show CloneVisitor;
import '../../scanner/token.dart' show Token;
+import '../fasta_codes.dart'
+ show
+ Message,
+ templateDuplicatedExport,
+ templateDuplicatedImport,
+ templateExportHidesExport,
+ templateImportHidesImport,
+ templateLocalDefinitionHidesExport,
+ templateLocalDefinitionHidesImport;
+
import '../loader.dart' show Loader;
import '../modifier.dart'
@@ -729,25 +739,15 @@ class KernelLibraryBuilder
}
if (preferred != null) {
if (isLocal) {
- if (isExport) {
- deprecated_addNit(charOffset,
- "Local definition of '$name' hides export from '${hiddenUri}'.");
- } else {
- deprecated_addNit(charOffset,
- "Local definition of '$name' hides import from '${hiddenUri}'.");
- }
+ var template = isExport
+ ? templateLocalDefinitionHidesExport
+ : templateLocalDefinitionHidesImport;
+ addNit(template.withArguments(name, hiddenUri), charOffset, fileUri);
} else {
- if (isExport) {
- deprecated_addNit(
- charOffset,
- "Export of '$name' (from '${preferredUri}') hides export from "
- "'${hiddenUri}'.");
- } else {
- deprecated_addNit(
- charOffset,
- "Import of '$name' (from '${preferredUri}') hides import from "
- "'${hiddenUri}'.");
- }
+ var template =
+ isExport ? templateExportHidesExport : templateImportHidesImport;
+ addNit(template.withArguments(name, preferredUri, hiddenUri),
+ charOffset, fileUri);
}
return preferred;
}
@@ -763,10 +763,10 @@ class KernelLibraryBuilder
});
}
}
- String message = isExport
- ? "'$name' is exported from both '${uri}' and '${otherUri}'."
- : "'$name' is imported from both '${uri}' and '${otherUri}'.";
- deprecated_addNit(charOffset, message);
+ var template =
+ isExport ? templateDuplicatedExport : templateDuplicatedImport;
+ Message message = template.withArguments(name, uri, otherUri);
+ addNit(message, charOffset, fileUri);
return new KernelInvalidTypeBuilder(name, charOffset, fileUri, message);
}

Powered by Google App Engine
This is Rietveld 408576698