| Index: pkg/front_end/lib/src/fasta/kernel/verifier.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/kernel/verifier.dart b/pkg/front_end/lib/src/fasta/kernel/verifier.dart
|
| index c98e6bc03d7f476857f514e92e19fc0e82f17588..7d4ed01d9b6dfaba797cc7014addba7da276d4a8 100644
|
| --- a/pkg/front_end/lib/src/fasta/kernel/verifier.dart
|
| +++ b/pkg/front_end/lib/src/fasta/kernel/verifier.dart
|
| @@ -24,13 +24,14 @@ import 'package:kernel/verifier.dart' show VerificationError, VerifyingVisitor;
|
|
|
| import '../deprecated_problems.dart' show deprecated_printUnexpected;
|
|
|
| +import '../fasta_codes.dart';
|
| +
|
| import 'redirecting_factory_body.dart' show RedirectingFactoryBody;
|
|
|
| -List<VerificationError> verifyProgram(Program program,
|
| - {bool isOutline: false}) {
|
| +List<LocatedMessage> verifyProgram(Program program, {bool isOutline: false}) {
|
| FastaVerifyingVisitor verifier = new FastaVerifyingVisitor(isOutline);
|
| program.accept(verifier);
|
| - return verifier.errors;
|
| + return verifier.errors.map(convertError).toList();
|
| }
|
|
|
| class FastaVerifyingVisitor extends VerifyingVisitor
|
| @@ -106,3 +107,13 @@ class FastaVerifyingVisitor extends VerifyingVisitor
|
| problem(null, "Unexpected appearance of the unknown type.");
|
| }
|
| }
|
| +
|
| +LocatedMessage convertError(VerificationError error) {
|
| + var node = error.node ?? error.context;
|
| + int offset = node?.fileOffset ?? -1;
|
| + var file = node?.location?.file;
|
| + Uri uri = file == null ? null : Uri.parse(file);
|
| + return templateInternalVerificationError
|
| + .withArguments(error.details)
|
| + .withLocation(uri, offset);
|
| +}
|
|
|