Files
pplus-library/mojo/probes/mut-uninitialized.mojo
T
alexm 568474d52f
Test (in pplus-core) / in-core (push) Failing after 28m44s
Initial commit
2026-11-12 22:23:48 -05:00

11 lines
221 B
Mojo

# probe: can a variable with no value yet be passed to a mut parameter? (no: "use of uninitialized value")
# expect: compile-error
def set_it(mut x: Int):
x = 5
def main():
var x: Int
set_it(x)
print(x)