Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 46e5208

Browse files
committed
[Bug 14659] Test untyped variables are initialised to nothing
If you don't specify a type for an LCB variable, the type is inferred to be `optional any`. `optional` types have `nothing` as their default value. Therefore, untyped variables should be initialised to `nothing`.
1 parent 57bde4c commit 46e5208

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/lcb/vm/default-values.lcb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,9 @@ public handler TestDefaultValueOfOptional()
3232
test "default value (optional)" when tOptional is nothing
3333
end handler
3434

35+
public handler TestDefaultValueOfUntyped()
36+
variable tVar
37+
test "default value (untyped)" when tVar is nothing
38+
end handler
39+
3540
end module

0 commit comments

Comments
 (0)