Skip to content

Commit

Permalink
move test file
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli committed Jan 30, 2025
1 parent 829f54e commit e8a9171
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
import "stdlib/io.jou"

@public
def maybe_undefined(n: int) -> None:
for i = 0; i < n; i++:
message = "Hi"
puts(message) # Warning: value of variable 'message' may be undefined
puts(message) # Warning: the value of 'message' may be undefined

@public
def surely_undefined_loop() -> None:
while False:
message = "Hi" # Warning: this code will never run
puts(message) # Warning: value of variable 'message' is undefined
puts(message) # Warning: the value of 'message' is undefined

@public
def surely_undefined_annotation() -> None:
x: byte*
puts(x) # Warning: value of variable 'x' is undefined
puts(x) # Warning: the value of 'x' is undefined

@public
def surely_undefined_assignments() -> None:
a: int
b = &a
c = b
d = c
e = *d # Warning: value of variable 'a' is undefined
e = *d # TODO: should emit warning, but this is too "advanced" for UVGs

def main() -> int:
return 0

0 comments on commit e8a9171

Please sign in to comment.