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 {
|
if contents == nil {
|
||||||
contents = t
|
contents = t
|
||||||
} else if !t.Contains(contents) {
|
} else if !c.typeMatches(t, contents) {
|
||||||
contents = &CompositeSignature{
|
contents = &CompositeSignature{
|
||||||
contents,
|
contents,
|
||||||
t,
|
t,
|
||||||
|
|
@ -431,6 +431,11 @@ func (c *Compiler) compile(tree Node) (TypeSignature, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
c.putU16(jumpOverElse, uint16(c.ip-jumpOverElse-2))
|
c.putU16(jumpOverElse, uint16(c.ip-jumpOverElse-2))
|
||||||
|
|
||||||
|
if dot.Equal(ot) {
|
||||||
|
return dot, nil
|
||||||
|
}
|
||||||
|
|
||||||
return &CompositeSignature{
|
return &CompositeSignature{
|
||||||
dot,
|
dot,
|
||||||
ot,
|
ot,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue