Added more tests

This commit is contained in:
Eduard Urbach 2025-02-14 00:26:48 +01:00
parent 2b9cecd62b
commit 5f3cb22779
Signed by: eduard
GPG key ID: 49226B848C78F6C8
8 changed files with 73 additions and 13 deletions

View file

@ -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
}