mirror of
https://github.com/enso-org/enso.git
synced 2024-12-26 03:41:36 +03:00
be91b1e8dd
https://github.com/enso-org/enso/pull/3764 introduced static wrappers for instance methods. Except it had a limitation to only be allowed for types with at least a single constructor. That excluded builtin types as well which, by default, don't have them. This limitation is problematic for Array/Vector consolidation and makes builtin types somehow second-citizens. This change lifts the limitation for builtin types only. Note that we do want to share the implementation of the generated builtin methods. At the same time due to the additional argument we have to adjust the starting index of the arguments. This change avoids messing with the existing dispatch logic, to avoid unnecessary complexity. As a result it is now possible to call builtin types' instance methods, statically: ``` arr = Array.new_1 42 Array.length arr ``` That would previously lead to missing method exception in runtime. # Important Notes The only exception is `Nothing`. Primarily because it requires `Nothing` to have a proper eigentype (`Nothing.type`) which would messed up a lot of existing logic for no obvious benefit (no more calling of `foo=Nothing` in parameters being one example). |
||
---|---|---|
.. | ||
Base/0.0.0-dev |