modifying runtime value from @parameter scope crashes the compiler

This is probably not an allowed operation, should there be a different error?
fn cmd_unchecked(args: Tuple) raises -> UnixSocket:
alias args_len = __type_of(args).__len__()
...
slices = InlineArray[StringSlice[__origin_of(args)], args_len]()

@parameter
for i in range(args_len):
slices[i] = args.get[i, StringSlice[__origin_of(args)]]()
...
fn cmd_unchecked(args: Tuple) raises -> UnixSocket:
alias args_len = __type_of(args).__len__()
...
slices = InlineArray[StringSlice[__origin_of(args)], args_len]()

@parameter
for i in range(args_len):
slices[i] = args.get[i, StringSlice[__origin_of(args)]]()
...
/Users/ec2-user/actions-runner/_work/modular/modular/open-source/mojo/stdlib/stdlib/builtin/_startup.mojo:113:4: error: call expansion failed
/Users/ec2-user/actions-runner/_work/modular/modular/open-source/mojo/stdlib/stdlib/builtin/_startup.mojo:68:4: note: function instantiation failed
/Users/ec2-user/actions-runner/_work/modular/modular/open-source/mojo/stdlib/stdlib/builtin/_startup.mojo:113:4: error: call expansion failed
/Users/ec2-user/actions-runner/_work/modular/modular/open-source/mojo/stdlib/stdlib/builtin/_startup.mojo:68:4: note: function instantiation failed
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server