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

Unified Diff: pkg/front_end/lib/src/fasta/scope.dart

Issue 2975163002: Remove deprecated API from scope. (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
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | pkg/front_end/messages.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/scope.dart
diff --git a/pkg/front_end/lib/src/fasta/scope.dart b/pkg/front_end/lib/src/fasta/scope.dart
index 178953241737779331dd6ba689f29460dd812fe7..c8fc36e294a8426b6a8d8177f2f987389f696af9 100644
--- a/pkg/front_end/lib/src/fasta/scope.dart
+++ b/pkg/front_end/lib/src/fasta/scope.dart
@@ -6,12 +6,17 @@ library fasta.scope;
import 'builder/builder.dart' show Builder, TypeVariableBuilder;
-import 'deprecated_problems.dart' show deprecated_InputError;
+import 'fasta_codes.dart'
+ show
+ LocatedMessage,
+ Message,
+ messageInternalProblemExtendingUnmodifiableScope,
+ templateAccessError,
+ templateDuplicatedName,
+ templatePreviousUseOfName;
import 'problems.dart' show internalProblem, unsupported;
-import 'fasta_codes.dart' show messageInternalProblemExtendingUnmodifiableScope;
-
class MutableScope {
/// Names declared in this scope.
Map<String, Builder> local;
@@ -188,12 +193,13 @@ class Scope extends MutableScope {
/// If name was used previously in this scope, this method returns an error
/// that should be reported as a compile-time error. The position of this
/// error is given by [charOffset] and [fileUri].
- deprecated_InputError declare(
+ LocatedMessage declare(
String name, Builder builder, int charOffset, Uri fileUri) {
if (isModifiable) {
if (usedNames?.containsKey(name) ?? false) {
- return new deprecated_InputError(
- fileUri, usedNames[name], "Previous use of '$name'.");
+ return templatePreviousUseOfName
+ .withArguments(name)
+ .withLocation(fileUri, usedNames[name]);
}
recordUse(name, charOffset, fileUri);
local[name] = builder;
@@ -279,7 +285,7 @@ abstract class ProblemBuilder extends Builder {
bool get hasProblem => true;
- String get deprecated_message;
+ Message get message;
@override
String get fullNameForErrors => name;
@@ -313,12 +319,12 @@ class AccessErrorBuilder extends ProblemBuilder {
bool get isLocal => builder.isLocal;
- String get deprecated_message => "Access error: '$name'.";
+ Message get message => templateAccessError.withArguments(name);
}
class AmbiguousBuilder extends ProblemBuilder {
AmbiguousBuilder(String name, Builder builder, int charOffset, Uri fileUri)
: super(name, builder, charOffset, fileUri);
- String get deprecated_message => "Duplicated named: '$name'.";
+ Message get message => templateDuplicatedName.withArguments(name);
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | pkg/front_end/messages.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698