Implemented type checks
This commit is contained in:
parent
baa2463b4b
commit
cacee7260a
19 changed files with 199 additions and 79 deletions
|
@ -41,7 +41,7 @@ func (f *Function) CompileDefinition(node *ast.Define) error {
|
|||
}
|
||||
|
||||
count := 0
|
||||
_, err := f.CompileCall(right)
|
||||
called, err := f.CompileCall(right)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -54,6 +54,10 @@ func (f *Function) CompileDefinition(node *ast.Define) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if called != nil {
|
||||
variable.Type = called.ReturnTypes[count]
|
||||
}
|
||||
|
||||
f.RegisterRegister(asm.MOVE, variable.Register, f.CPU.Output[count])
|
||||
f.AddVariable(variable)
|
||||
count++
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue