charly-vm icon indicating copy to clipboard operation
charly-vm copied to clipboard

Builtin classes should be able to override constructor as regular function

Open KCreate opened this issue 3 years ago • 0 comments

Would allow neat and tidy syntax for cast operations, e.g:

Int("25")
Number(some_user_input)
Tuple(some_list)

This can be implemented as an additional check after the kFlagNonConstructable check at interpreter.cpp:115.

The runtime should just call the constructor directly without creating an instance value first

KCreate avatar Jul 25 '22 12:07 KCreate