irken-compiler
irken-compiler copied to clipboard
type errors with 'object protocol'.
The type solver is not catching some type errors when using object support (i.e., ob::method syntax).
This particular case involved iterating over a map, I accidentally swapped the types of the key and value, and the typer did not catch the error.
Found a nice repro:
(define get-dtcon-tag
'nil label -> (alist/get the-context.variant-labels label "unknown variant label")
dt variant -> (let ((dtob (alist/get the-context.datatypes dt "no such datatype")))
(dtob.get variant)))
Which wanted to be this:
(define get-dtcon-tag
'nil label -> (alist/get the-context.variant-labels label "unknown variant label")
dt variant -> (let ((dtob (alist/get the-context.datatypes dt "no such datatype"))
(alt (dtob.get variant)))
alt.index))
The type phase did not catch this error.