Commit d762884
Params declared with a ref/mut mode (e.g. `ref self`, `ref other: Int`)
are lowered to their bare value type — the borrow checker tracks the
actual borrow, not the type. But OpDeref required the operand to unify
with `TRef tv`, so stdlib code reading ref params via `*self`/`*other`
(traits.affine Eq/Ord/Hash/Display impls for Int/Bool) failed with
`Unify (ref tv, Int)`.
Make `*e` peel one borrow layer when e is TRef/TMut/TOwn and act as the
identity on a value type. Real reference types still deref to inner;
value types unchanged -> no regression.
stdlib 16->17/19; 233/233 dune test, zero regression.
Refs #128
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 367197d commit d762884
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
943 | 955 | | |
944 | 956 | | |
945 | 957 | | |
| |||
0 commit comments