Hiii, I want to confirm is impossible currently de...
# general-advice
r
Hiii, I want to confirm is impossible currently define a contract to specify the subclass return type For example:
Copy code
public fun Vector2?.asVariant(): Variant = if (this == null) Variant.NIL() else Variant.VECTOR2(this)
Can I add a contract to smart cast return type to specifics subclasses?? Otherwise I needs to define a overload with non-null receiver right??