fix typing of if and lists

This commit is contained in:
Neemek 2026-07-12 11:39:22 +02:00
parent d54249cffe
commit dd7af341a3
Signed by: neemek
GPG key ID: 84FFE4D7D40AB25E

View file

@ -291,7 +291,7 @@ func (c *Compiler) compile(tree Node) (TypeSignature, error) {
if contents == nil {
contents = t
} else if !t.Contains(contents) {
} else if !c.typeMatches(t, contents) {
contents = &CompositeSignature{
contents,
t,
@ -431,6 +431,11 @@ func (c *Compiler) compile(tree Node) (TypeSignature, error) {
}
c.putU16(jumpOverElse, uint16(c.ip-jumpOverElse-2))
if dot.Equal(ot) {
return dot, nil
}
return &CompositeSignature{
dot,
ot,