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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_target.dart

Issue 2777533002: Report compile-time error on invalid constructors. (Closed)
Patch Set: Update status files. Created 3 years, 9 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/test/fasta/compile.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
index 4f8b29fdd76eccac3c769eeeac63073cfac7899c..dfacddc4f451a70999418073ef8c0104d1a4ae31 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
@@ -567,6 +567,16 @@ class KernelTarget extends TargetImplementation {
superTarget ??= defaultSuperConstructor(cls);
Initializer initializer;
if (superTarget == null) {
+ Uri uri = constructor.enclosingClass.fileUri == null
+ ? null
+ : Uri.parse(constructor.enclosingClass.fileUri);
+ InputError error = new InputError(
+ uri,
+ constructor.fileOffset,
+ "${cls.superclass.name} has no constructor that takes no"
+ " arguments.");
+ print(error.format());
+ errors.add(error);
initializer = new InvalidInitializer();
} else {
initializer =
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | pkg/front_end/test/fasta/compile.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698