Index: pkg/front_end/lib/src/fasta/loader.dart |
diff --git a/pkg/front_end/lib/src/fasta/loader.dart b/pkg/front_end/lib/src/fasta/loader.dart |
index ed576aa07c5b9977983fb3177cbb1cf1e727e294..273f1a50312a33b6f3d3fa50fe64513a1e04ab00 100644 |
--- a/pkg/front_end/lib/src/fasta/loader.dart |
+++ b/pkg/front_end/lib/src/fasta/loader.dart |
@@ -11,7 +11,9 @@ import 'dart:collection' show Queue; |
import 'builder/builder.dart' show Builder, LibraryBuilder; |
import 'deprecated_problems.dart' |
- show deprecated_InputError, firstSourceUri, deprecated_printUnexpected; |
+ show firstSourceUri, deprecated_printUnexpected; |
+ |
+import 'messages.dart' show LocatedMessage, Message, templateUnspecified; |
import 'target_implementation.dart' show TargetImplementation; |
@@ -31,14 +33,14 @@ abstract class Loader<L> { |
/// |
/// A handled error is an error that has been added to the generated AST |
/// already, for example, as a throw expression. |
- final List<deprecated_InputError> handledErrors = <deprecated_InputError>[]; |
+ final List<LocatedMessage> handledErrors = <LocatedMessage>[]; |
/// List of all unhandled compile-time errors seen so far by libraries loaded |
/// by this loader. |
/// |
/// An unhandled error is an error that hasn't been handled, see |
/// [handledErrors]. |
- final List<deprecated_InputError> unhandledErrors = <deprecated_InputError>[]; |
+ final List<LocatedMessage> unhandledErrors = <LocatedMessage>[]; |
LibraryBuilder coreLibrary; |
@@ -165,14 +167,24 @@ ${format(ms / libraryCount, 3, 12)} ms/compilation unit."""); |
/// |
/// If [wasHandled] is true, this error is added to [handledErrors], |
/// otherwise it is added to [unhandledErrors]. |
+ void addCompileTimeError(Message message, int charOffset, Uri fileUri, |
+ {bool silent: false, bool wasHandled: false}) { |
+ if (!silent) { |
+ deprecated_printUnexpected(fileUri, charOffset, message.message); |
+ } |
+ (wasHandled ? handledErrors : unhandledErrors) |
+ .add(message.withLocation(fileUri, charOffset)); |
+ } |
+ |
void deprecated_addCompileTimeError( |
- Uri fileUri, int charOffset, Object message, |
+ Uri fileUri, int charOffset, String message, |
{bool silent: false, bool wasHandled: false}) { |
if (!silent) { |
deprecated_printUnexpected(fileUri, charOffset, message); |
} |
- (wasHandled ? handledErrors : unhandledErrors) |
- .add(new deprecated_InputError(fileUri, charOffset, message)); |
+ (wasHandled ? handledErrors : unhandledErrors).add(templateUnspecified |
+ .withArguments(message) |
+ .withLocation(fileUri, charOffset)); |
} |
Builder getAbstractClassInstantiationError() { |