We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example code; (Is there a name for this?)
const io = @import("std").io; // (1) Does not work as expected?! //const cpf = io.stdout.printf; var vpf = io.stdout.printf; pub fn main(args: [][] u8) -> %void { // (1) Works here const cpf = io.stdout.printf; %%io.stdout.printf("args.len={}\n", args.len); // (1) When cpf in global scope // zig: ../src/codegen.cpp:767: LLVMOpaqueValue* ir_llvm_value(CodeGen*, IrInstruction*): // Assertion `instruction->value.special != ConstValSpecialRuntime' failed. // Aborted %%cpf("args.len={}\n", args.len); for (args) |*a| { %%io.stdout.printf("{}\n", *a); %%cpf("{}\n", *a); // ./bug001.zig:14:11: error: type '(bound fn(&OutStream,var,var)->var)' not a function // %%vpf("{}\n", *a); } }
The text was updated successfully, but these errors were encountered:
Thanks for this report. I've been working on it all day and it's revealed some deeper problems that I am fixing.
Sorry, something went wrong.
rework compile-time known pointer values
39287d7
See #257
cpf at global scope works now. As for vpf, I think that's the same issue as #141.
cpf
vpf
No branches or pull requests
Example code; (Is there a name for this?)
The text was updated successfully, but these errors were encountered: