New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow using Object
and similar types as instance variable types
#2733
Comments
struct Foo
@thing : Object
end
|
Objects larger than 64 bits will be boxed in heap memory. |
Mmm... but for that case, I'm not sure. |
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 |
Hello What priority does this issue have right now? |
Bump. IMO the value should always be boxed when passed as |
Reason for closing? |
I just had this idea: module ValueM; end
module ReferenceM; end
struct Value
include ValueM
end
class Reference
include ReferenceM
end
alias Any = ValueM | ReferenceM Of course, doing it this way means For typeof([1].as(Indexable)[0]) |
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.
The text was updated successfully, but these errors were encountered: