Index: pkg/front_end/lib/src/fasta/kernel/kernel_named_type_builder.dart |
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_named_type_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_named_type_builder.dart |
index e41d72bb2b866a74d09b127642b68c79d70d07e1..702294d0bdde348e0784feb5c206677b946f38ce 100644 |
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_named_type_builder.dart |
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_named_type_builder.dart |
@@ -6,7 +6,12 @@ library fasta.kernel_interface_type_builder; |
import 'package:kernel/ast.dart' show DartType, DynamicType, Supertype; |
-import '../messages.dart' show templateTypeNotFound, warning; |
+import '../messages.dart' |
+ show |
+ templateSupertypeIsIllegal, |
+ templateSupertypeIsTypeVariable, |
+ templateTypeNotFound, |
+ warning; |
import 'kernel_builder.dart' |
show |
@@ -43,11 +48,11 @@ class KernelNamedTypeBuilder |
} |
Supertype handleInvalidSupertype(LibraryBuilder library) { |
- String message = builder.isTypeVariable |
- ? "The type variable '$name' can't be used as supertype." |
- : "The type '$name' can't be used as supertype."; |
- library.deprecated_addCompileTimeError(charOffset, message, |
- fileUri: fileUri); |
+ var template = builder.isTypeVariable |
+ ? templateSupertypeIsTypeVariable |
+ : templateSupertypeIsIllegal; |
+ library.addCompileTimeError( |
+ template.withArguments(name), charOffset, fileUri); |
return null; |
} |