Open vjovanov opened 9 years ago
You can not get rid of inline t
as following won't typecheck even if we had ascriptions:
f = inline (x: inline Int) => x
f(2: inline Int)
You can not ascribe term to be of a more specific type.
It will, we will add a weak promotion.
I don't think that adding implicit promotions to core calculus would make anything simpler. If you don't like evaluation on inline terms just strip them after typechecking and use the types.
We need to discuss...
Static to inline is the same problem. You just can not promote simply because of nested types. In the implementation I crawl the type-structure and fix it all up. Maybe we simply do not put this in the calculus, for now.
I do not know how to do promoting inline to dynamic, here is why: How do you convert
inline List[inline Tuple2[Int, inline Int]]
into aList[Tuple2[Int, Int]]
. The problem is that you need to go through the term and delete all inlines :)Idea: Maybe we need to get rid of the
inline t
anddynamic t
and make the partial evaluator purely type-driven. The sub-typing would take care of the rest I suppose except for promoting static to inline.