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 210e5a11886da11fda5cb602790742f26eeabbcf..0893ca26e3d1c8867e1a52ba21880bb69577b9db 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 |
@@ -80,8 +80,14 @@ abstract class KernelFunctionBuilder |
compilationUnit, charOffset); |
void set body(Statement newBody) { |
- if (isAbstract && newBody != null) { |
- return internalError("Attempting to set body on abstract method."); |
+ if (newBody != null) { |
+ if (isAbstract) { |
+ return internalError("Attempting to set body on abstract method."); |
+ } |
+ if (isExternal) { |
+ return library.addCompileTimeError( |
+ newBody.fileOffset, "An external method can't have a body."); |
+ } |
} |
actualBody = newBody; |
if (function != null) { |