in check/src/main/scala/rsc/checkoutline/Checker.scala [237:293]
private def highlevelPatch(tpe: Type): Type = {
tpe match {
case TypeRef(pre, sym, targs) =>
val pre1 = highlevelPatch(pre)
val sym1 = highlevelPatch(sym)
val targs1 = targs.map(highlevelPatch)
TypeRef(pre1, sym1, targs1)
case SingleType(pre, sym) =>
val pre1 = highlevelPatch(pre)
val sym1 = highlevelPatch(sym)
SingleType(pre1, sym1)
case ThisType(sym) =>
val sym1 = highlevelPatch(sym)
ThisType(sym1)
case SuperType(pre, sym) =>
val pre1 = highlevelPatch(pre)
val sym1 = highlevelPatch(sym)
SuperType(pre1, sym1)
case ConstantType(constant) =>
val constant1 = constant
ConstantType(constant1)
case IntersectionType(tpes) =>
val tpes1 = tpes.map(highlevelPatch)
IntersectionType(tpes1)
case UnionType(tpes) =>
val tpes1 = tpes.map(highlevelPatch)
UnionType(tpes1)
case WithType(tpes) =>
val tpes1 = tpes.map(highlevelPatch)
WithType(tpes1)
case StructuralType(tpe, decls) =>
val tpe1 = highlevelPatch(tpe)
val decls1 = decls.map(highlevelPatch)
StructuralType(tpe1, decls1)
case AnnotatedType(anns, tpe) =>
// FIXME: https://github.com/twitter/rsc/issues/93
val anns1 = Nil
val tpe1 = highlevelPatch(tpe)
AnnotatedType(anns1, tpe1)
case ExistentialType(tpe, decls) =>
val tpe1 = highlevelPatch(tpe)
val decls1 = decls.map(highlevelPatch)
ExistentialType(tpe1, decls1)
case UniversalType(tparams, tpe) =>
val tparams1 = tparams.map(highlevelPatch)
val tpe1 = highlevelPatch(tpe)
UniversalType(tparams1, tpe1)
case ByNameType(tpe) =>
val tpe1 = highlevelPatch(tpe)
ByNameType(tpe1)
case RepeatedType(tpe) =>
val tpe1 = highlevelPatch(tpe)
RepeatedType(tpe1)
case NoType =>
NoType
}
}