Sema: explain why we tried to call an extern fn at comptime
I recently saw a user hit the "comptime call of extern function" error, and get confused because they didn't know why the scope was `comptime`. So, use `explainWhyBlockIsComptime` on this and related errors to add all the relevant notes. The added test case shows the motivating situation.
This commit is contained in:
@@ -11,4 +11,5 @@ export fn entry1() void {
|
||||
// error
|
||||
//
|
||||
// :4:15: error: comptime call of extern function
|
||||
// :4:5: note: 'comptime' keyword forces comptime evaluation
|
||||
// :8:5: error: inline call of extern function
|
||||
|
||||
Reference in New Issue
Block a user