Added more tests
This commit is contained in:
parent
2b9cecd62b
commit
5f3cb22779
8 changed files with 73 additions and 13 deletions
|
@ -25,12 +25,11 @@ func (f *Function) CompileDefinition(node *ast.Define) error {
|
|||
return err
|
||||
}
|
||||
|
||||
variable.Type = typ
|
||||
|
||||
if variable.Type == nil {
|
||||
return errors.New(errors.CouldNotInferType, f.File, node.Expression.Token.End())
|
||||
if typ == nil {
|
||||
return errors.New(errors.UntypedExpression, f.File, node.Expression.Token.End())
|
||||
}
|
||||
|
||||
variable.Type = typ
|
||||
f.AddVariable(variable)
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue