Index: src/typing-asm.cc |
diff --git a/src/typing-asm.cc b/src/typing-asm.cc |
index d98998520fae35bbc16c305979a6123df1be0cd7..fc6309141729c04842fddeb1c3ee2cdeaa177bf3 100644 |
--- a/src/typing-asm.cc |
+++ b/src/typing-asm.cc |
@@ -166,6 +166,10 @@ void AsmTyper::VisitFunctionDeclaration(FunctionDeclaration* decl) { |
// Set function type so global references to functions have some type |
// (so they can give a more useful error). |
Variable* var = decl->proxy()->var(); |
+ if (GetVariableInfo(var)) { |
+ // Detect previously-seen functions. |
+ FAIL(decl->fun(), "function repeated in module"); |
+ } |
SetType(var, Type::Function()); |
} |