Simplified type system

This commit is contained in:
2025-02-04 23:58:01 +01:00
parent bde68d4d64
commit 8421a21c9a
16 changed files with 70 additions and 55 deletions

View File

@ -92,10 +92,10 @@ func (f *Function) CompileCall(root *expression.Expression) (*Function, error) {
return nil, err
}
if !types.Check(typ, fn.Parameters[i].Type) {
if !types.Is(typ, fn.Parameters[i].Type) {
return nil, errors.New(&errors.TypeMismatch{
Encountered: typ.UniqueName(),
Expected: fn.Parameters[i].Type.UniqueName(),
Encountered: typ.Name(),
Expected: fn.Parameters[i].Type.Name(),
ParameterName: fn.Parameters[i].Name,
}, f.File, parameters[i].Token.Position)
}