raulraja
06/22/2019, 8:36 PMclass Option<A> : OptionOf<A> // OptionOf<A> is a generated type alias
fun proof() : Option<Int> {
val x: OptionOf<Int> = Option(1)
return x // this would normally not type check but I want to smart cast this so the compiler treats all references of OptionOf<A> as Option<A> automatically.
}
This would allows us to remove fix
from arrow when moving from kinded types to concrete types which currently requires a dirty cast the use needs to invoke with .fix()
Which phase or relevant classes would you recommend I look into that perform either type susbtitution or PSI Element rewritting. The rewrite is easy… For any type infered or found as OptionOf
rewrite it as if it was Option
.