Object, Reference, Enum, Enumerable and many other types that are currently disallowed should be able to be used as the type of instance, class and global variables.
This is a current limitation of the language but it's doable. It will come with time.
struct Foo
@thing : Object
end
Object is a superclass of any struct. That mean @thing can contain any struct or the program. So sizeof(@thing) is the size of the largest struct known plus 4 bytes for the type id. Does that mean @thing can contain Foo itself? It gets cyclic.
Objects larger than 64 bits will be boxed in heap memory.
Mmm... but for that case, I'm not sure. Object wlll be represented as a 64 bits raw pointer... I guess that can be codegen'd, not sure. Maybe it'll be an error.
I can be unexpected that some times it is copied by value and some others it is copied by reference (boxed). Maybe it could be always boxed when the type is Object.
Hello
What priority does this issue have right now?
Bump. IMO the value should always be boxed when passed as Object, so that there's less magic and unpredictability.
Reason for closing?