fix typing of if and lists
This commit is contained in:
parent
d54249cffe
commit
dd7af341a3
1 changed files with 6 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue