Open vjovanov opened 9 years ago
I don't think that what you are saying is sound.
val x: dynamic Int = 2
val f: static (static Int => dynamic Int) = (y: static Int) => x + y
f(1)
You can not just promote result type here.
Yes it is, if the function is pure. You want all you functions without parameters to be either all static or all dynamic in the type.
if you have a dot function you do not want to promote stuff to inline I suppose:
dot(Vector(1,2,3), Vector(1,2,3))
should work since Vector
is statically known.
Look at the example I've given, it's unsound. x
can come from anywhere, you might not be able to compute it, dynamic stuff doesn't have to be pure.
In the implementation a result of a static function that has dynamic parameters is promoted to static if applied with all static stuff. E.g:
How do we express this desugaring?