You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree that we need a better error message here, but the error itself is not incorrect/inconsistent.
I think what you meant was
(bind-val f [i64,i64]* (myclosure 4))
Which functions correctly.
Maybe change this issue to reflect the compilers poor error reporting of this condition.
From: cianoc
Sent: Saturday, 6 January 2018 2:51 PM
To: digego/extempore
Cc: Subscribed
Subject: [digego/extempore] Compiler error when defining an anonymous closure(#310)
When running the following code:
(bind-func my-closure
(lambda (x:i64)
(lambda (y) (+ x y))))
(bind-val f [i64*,i64*]* (myclosure 4))
($ (f 5)) ;; this triggers the error
I get the following message from the compiler:
Compiler Error compiler failed
**** DECL ****
@f = external global { i8*, i8*, i64* (i8*, i8*, i64*)* }**
declare %mzone* @llvm_pop_zone_stack ()
declare void @llvm_zone_destroy (%mzone*)
declare i8* @malloc (i64)
declare i8* @Memset (i8*, i32, i64)
declare i8* @strcpy (i8*, i8*)
declare %String* @toString_poly_W1N0cmluZyosaTY0Kl0q (i64*)
declare %String* @zcopy_adhoc_W1N0cmluZyosU3RyaW5nKixtem9uZSosbXpvbmUqXQ (%String*, %mzone*, %mzone*)
declare i8* @zcopy_poly_W2k4KixpOCosbXpvbmUqLG16b25lKl0q (i8*, %mzone*, %mzone*)
**** ENDDECL ****
LLVM IR: <string>:150:32: error: '%f1071' defined with type 'i64* (i8*, i8*, i64*)*'
%result1076 = call fastcc i64* %f1071(i8* %z1075, i8* %e1072, i64 5)
^
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
cianoc
changed the title
Compiler error when defining an anonymous closure
Confusing compiler error when binding an anonymous function to a global variable with the wrong type.
Jan 8, 2018
When running the following code:
I get the following message from the compiler:
The text was updated successfully, but these errors were encountered: