nac3/nac3core
David Mak 2722a7a17f core: Do not keep unification result for function arguments
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.
2023-12-15 12:26:47 +08:00
..
src core: Do not keep unification result for function arguments 2023-12-15 12:26:47 +08:00
Cargo.toml meta: Update cargo dependencies 2023-12-12 15:41:59 +08:00
build.rs core: Apply clippy pedantic changes 2023-12-11 15:16:23 +08:00