David Mak
f09f3c27a5
For some reason, when unifying a function call parameter with an argument, subsequent calls to the same function will only accept the type of the substituted argument. This affect snippets like: ``` def make1() -> C[Literal[1]]: return ... def make2() -> C[Literal[2]]: return ... def consume(instance: C[Literal[1, 2]]): pass consume(make1()) consume(make2()) ``` The last statement will result in a compiler error, as the parameter of consume is replaced with C[Literal[1]]. We fix this by getting a snapshot before performing unification, and restoring the snapshot after unification succeeds. |
||
---|---|---|
.. | ||
demo | ||
src | ||
Cargo.toml |