You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, class definitions must re-declare all of their parent classes interface if they want to be used, which is repetitive.
Also, subclasses must static_cast themselves to jobjects to be used in a context their subclass is required which loses type safety.
enum classes are basically syntactic sugar for a subclassing, so this likely needs to be implemented first.
It will be nice to unify the type system to enable interface of Object throughout Java. That said, Kotlin's Any is not Java's Object, so any solution should not presume this.
The text was updated successfully, but these errors were encountered:
I dug into this a bit, and I think this may unfortunately be blocked by #4.
To expose a syntax where an object can invoke a parent's function, there needs to be a mechanism to discover the method using a char*.
Currently, the full set is known, so in ObjectRef it's possible to simply use the InvocableMap.
At first I thought I could simply daisy chain inheritance of ObjectRef types but this isn't viable. First, if the operator() is selected, but all candidates discarded (e.g. if a parent class function call is made on a subclass), the child most class will be selected, and only its InvocableMap will offer candidates (not parents).
I considered trying to build a map of candidates for each layer of inheritance, but this is difficult to do and maintain costexpr-ness. I think if a class was constructed in such a way as to expose a Walk metafunction that moves from child to parent class, it might be possible to compile time construct a map of candidate names, and then expose this directly to InvocableMap.
This problem may be easier to solve after migrating to C++20, so I may take a detour to do so. Much of the C++17 implementation exploits tricks in the type system to workaround not having string literals (i.e. non type templates).
Currently, class definitions must re-declare all of their parent classes interface if they want to be used, which is repetitive.
Also, subclasses must
static_cast
themselves tojobject
s to be used in a context their subclass is required which loses type safety.enum classes are basically syntactic sugar for a subclassing, so this likely needs to be implemented first.
It will be nice to unify the type system to enable interface of
Object
throughout Java. That said, Kotlin'sAny
is not Java'sObject
, so any solution should not presume this.The text was updated successfully, but these errors were encountered: