Files
sx/tests/expected/254-deref-non-pointer-reject.txt
agra 497d450ba7 fix(lower): diagnose .* on a non-pointer instead of codegen panic
`lowerDerefExpr` left the deref's result type `.unresolved` when the
operand wasn't a pointer (e.g. a stale `value.*` after a parameter
changed from `*T` to `T`), and emitted the `.deref` anyway. That
unresolved type slipped through to emit_llvm's "unresolved type reached
LLVM emission" panic with no source location.

Now it emits a clean diagnostic at the deref site
("cannot dereference with `.*`: 'T' is not a pointer") and recovers.
Regression: examples/254-deref-non-pointer-reject.sx.
2026-06-01 17:37:27 +03:00

6 lines
234 B
Plaintext

error: cannot dereference with `.*`: 'Point' is not a pointer
--> /Users/agra/projects/sx/examples/254-deref-non-pointer-reject.sx:12:10
|
12 | q := p.*; // ERROR: `p` is a Point value, not a pointer
| ^