Added support for unions as a step towards lowering ADTs in the next pass to be written.
This commit is contained in:
1 parent
d44293a48b
commit
4de7dd1210
8 files changed
+55
-13
No files matched your search
@@ -0,0 +1,3 @@
|
||||
true
|
||||
4
|
||||
4.400000
|
||||
@@ -0,0 +1,22 @@
|
||||
import io:*
|
||||
|
||||
uni packed {
|
||||
var a: int
|
||||
var b: double
|
||||
}
|
||||
|
||||
obj loose {
|
||||
var a: int
|
||||
var b: double
|
||||
}
|
||||
|
||||
fun main():int {
|
||||
var a: packed
|
||||
var b: loose
|
||||
println(#sizeof<packed> < #sizeof<loose>)
|
||||
a.a = 4
|
||||
println(a.a)
|
||||
a.b = 4.4
|
||||
println(a.b)
|
||||
return 0
|
||||
}
|
||||
Reference in new issue
Block a user