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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_procedure_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_procedure_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart
index 8c092c031c11ea22f52c535a8b4d9defd41dc394..5ae57e92e7f4a32d4ef299e995331f06e3bec24d 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart
@@ -44,9 +44,9 @@ import 'package:kernel/ast.dart'
import 'package:kernel/type_algebra.dart' show containsTypeVariable, substitute;
-import '../errors.dart' show internalError;
+import '../deprecated_problems.dart' show deprecated_internalProblem;
-import '../messages.dart' show warning;
+import '../messages.dart' show deprecated_warning;
import '../loader.dart' show Loader;
@@ -65,7 +65,7 @@ import 'kernel_builder.dart'
ProcedureBuilder,
TypeVariableBuilder,
isRedirectingGenerativeConstructorImplementation,
- memberError;
+ deprecated_memberError;
abstract class KernelFunctionBuilder
extends ProcedureBuilder<KernelTypeBuilder> {
@@ -91,14 +91,15 @@ abstract class KernelFunctionBuilder
void set body(Statement newBody) {
if (newBody != null) {
if (isAbstract) {
- return internalError("Attempting to set body on abstract method.");
+ return deprecated_internalProblem(
+ "Attempting to set body on abstract method.");
}
if (isExternal) {
- return library.addCompileTimeError(
+ return library.deprecated_addCompileTimeError(
newBody.fileOffset, "An external method can't have a body.");
}
if (isConstructor && isConst) {
- return library.addCompileTimeError(
+ return library.deprecated_addCompileTimeError(
newBody.fileOffset, "A const constructor can't have a body.");
}
}
@@ -150,7 +151,7 @@ abstract class KernelFunctionBuilder
substitution[parameter] = const DynamicType();
}
}
- warning(fileUri, charOffset,
+ deprecated_warning(fileUri, charOffset,
"Can only use type variables in instance methods.");
return substitute(type, substitution);
}
@@ -353,7 +354,7 @@ class KernelConstructorBuilder extends KernelFunctionBuilder {
void checkSuperOrThisInitializer(Initializer initializer) {
if (superInitializer != null || redirectingInitializer != null) {
- memberError(
+ deprecated_memberError(
target,
"Can't have more than one 'super' or 'this' initializer.",
initializer.fileOffset);
@@ -369,11 +370,15 @@ class KernelConstructorBuilder extends KernelFunctionBuilder {
checkSuperOrThisInitializer(initializer);
redirectingInitializer = initializer;
if (constructor.initializers.isNotEmpty) {
- memberError(target, "'this' initializer must be the only initializer.",
+ deprecated_memberError(
+ target,
+ "'this' initializer must be the only initializer.",
initializer.fileOffset);
}
} else if (redirectingInitializer != null) {
- memberError(target, "'this' initializer must be the only initializer.",
+ deprecated_memberError(
+ target,
+ "'this' initializer must be the only initializer.",
initializer.fileOffset);
} else if (superInitializer != null) {
// If there is a super initializer ([initializer] isn't it), we need to

Powered by Google App Engine
This is Rietveld 408576698