2022-01-20 20:36:05 +03:00
|
|
|
# Ensure type dependencies are properly considered in slurping
|
|
|
|
|
|
|
|
https://github.com/unisonweb/unison/pull/2821
|
|
|
|
|
|
|
|
```ucm:hide
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> builtins.merge
|
2022-01-20 20:36:05 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Define a type.
|
|
|
|
|
|
|
|
```unison:hide
|
|
|
|
structural type Y = Y
|
|
|
|
```
|
|
|
|
|
|
|
|
```ucm:hide
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> add
|
2022-01-20 20:36:05 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Now, we update `Y`, and add a new type `Z` which depends on it.
|
|
|
|
|
|
|
|
```unison
|
|
|
|
structural type Z = Z Y
|
|
|
|
structural type Y = Y Nat
|
|
|
|
```
|
|
|
|
|
|
|
|
Adding should fail for BOTH definitions, `Y` needs an update and `Z` is blocked by `Y`.
|
|
|
|
```ucm:error
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> add
|
2022-01-20 20:36:05 +03:00
|
|
|
-- This shouldn't exist, because it should've been blocked.
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> view Z
|
2022-01-20 20:36:05 +03:00
|
|
|
```
|