Improved type system

This commit is contained in:
2024-08-08 12:55:25 +02:00
parent d624a5f895
commit 5d9be01a85
20 changed files with 111 additions and 67 deletions

View File

@ -5,7 +5,6 @@ import (
"git.akyoto.dev/cli/q/src/ast"
"git.akyoto.dev/cli/q/src/errors"
"git.akyoto.dev/cli/q/src/expression"
"git.akyoto.dev/cli/q/src/types"
)
// CompileDefinition compiles a variable definition.
@ -28,7 +27,7 @@ func (f *Function) CompileDefinition(node *ast.Define) error {
variable.Type = typ
if variable.Type == types.Invalid {
if variable.Type == nil {
return errors.New(errors.UnknownType, f.File, node.Expression.Token.End())
}