Open vjovanov opened 9 years ago
/cc @densh
I'd say desugar @i?
annotated types into generics:
def f(x: Foo @i?) = t
--->
[F <: Foo] => (x: F) => t
Then a type system should be able to do all the work for you (provided there is type inference, of course.)
Let's discuss when you are here.
We decided to drop @i?
, didn't we? Can we close the issue now?
According to the current design of the type system we just use
@i!
and say that@i?
means convert to inline if static. This is tricky though as bodies of methods that have@i?
are hard to typecheck:This is solved by having a mechanism that evaluates all static values to inline. How about when we have:
How do we know here that types are OK? What if
addOne
was a third party library and did not have@i?
. Would we have to promote it to inline conditionally, or we should reject that program?