<@U2SG23BPU> I’m attempting to perform a type subs...
# arrow-meta
r
@dsavvinov I’m attempting to perform a type substitution and I’m guessing I need to do that somewhere in the Resolve phase or provide my own Declaration factory. Here is an example of what I’m trying to accomplish:
Copy code
class 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
.