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

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

Issue 2932973003: Various semantic checks regarding const and final. (Closed)
Patch Set: Created 3 years, 6 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 0893ca26e3d1c8867e1a52ba21880bb69577b9db..6a5b9a368b78ac1ecf135e7ebf9f92a8b0a0c22a 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
@@ -88,6 +88,10 @@ abstract class KernelFunctionBuilder
return library.addCompileTimeError(
newBody.fileOffset, "An external method can't have a body.");
}
+ if (isConstructor && isConst) {
+ return library.addCompileTimeError(
+ newBody.fileOffset, "A const constructor can't have a body.");
+ }
}
actualBody = newBody;
if (function != null) {

Powered by Google App Engine
This is Rietveld 408576698