Spurious "cannot type this" on a header pointer #41

Closed
opened 2026-10-08 18:43:04 +02:00 by alex-eg · 0 comments
Owner

sexc dfafe8b. In src/viewer.sex:

(var font (* struct nk-font) (nk-font-atlas-add-default ...))
(/= (. font handle height) scale)

This warns cannot type this; `.' reads it as a value font, yet the
emitted C is the correct font->handle.height /= scale;. The variable's
type is written out, so the warning is wrong on both counts: the type
is known, and the access isn't read as a value. The nearby
(& (. font handle)) gives no warning.


Found with sexc dfafe8b while building vs-map-viewer (from its Sex-field-notes.org).

sexc dfafe8b. In `src/viewer.sex`: ```scheme (var font (* struct nk-font) (nk-font-atlas-add-default ...)) (/= (. font handle height) scale) ``` This warns ``cannot type this; `.' reads it as a value font``, yet the emitted C is the correct `font->handle.height /= scale;`. The variable's type is written out, so the warning is wrong on both counts: the type is known, and the access isn't read as a value. The nearby `(& (. font handle))` gives no warning. --- Found with sexc `dfafe8b` while building vs-map-viewer (from its `Sex-field-notes.org`).
alex-eg added the bug label 2026-10-08 18:43:04 +02:00
Sign in to join this conversation.