Improved type system checks
This commit is contained in:
parent
f1c8b2daf5
commit
e2f607805c
9 changed files with 49 additions and 61 deletions
|
@ -40,7 +40,7 @@ func (f *Function) CompileDefinition(node *ast.Define) error {
|
|||
}
|
||||
|
||||
count := 0
|
||||
called, err := f.CompileCall(right)
|
||||
types, err := f.CompileCall(right)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -53,8 +53,8 @@ func (f *Function) CompileDefinition(node *ast.Define) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if called != nil {
|
||||
variable.Type = called.Output[count].Type
|
||||
if count < len(types) {
|
||||
variable.Type = types[count]
|
||||
}
|
||||
|
||||
f.RegisterRegister(asm.MOVE, variable.Register, f.CPU.Output[count])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue