...
This commit is contained in:
@@ -366,7 +366,9 @@ public sealed class TypeChecker
|
||||
|
||||
if (function != null)
|
||||
{
|
||||
return new FuncIdentifierNode(ResolveType(function.FuncType), _syntaxTree.Metadata.ModuleName, expression.Name, function.ExternSymbol);
|
||||
var parameters = function.Parameters.Select(x => ResolveType(x.Type)).ToList();
|
||||
var type = new FuncTypeNode(parameters, ResolveType(function.ReturnType));
|
||||
return new FuncIdentifierNode(type, _syntaxTree.Metadata.ModuleName, expression.Name, function.ExternSymbol);
|
||||
}
|
||||
|
||||
throw new TypeCheckerException(Diagnostic.Error($"Symbol {expression.Name} not found").At(expression).Build());
|
||||
@@ -385,7 +387,9 @@ public sealed class TypeChecker
|
||||
var function = module.Functions(includePrivate).FirstOrDefault(x => x.Name == expression.Name);
|
||||
if (function != null)
|
||||
{
|
||||
return new FuncIdentifierNode(ResolveType(function.FuncType), expression.Module, expression.Name, function.ExternSymbol);
|
||||
var parameters = function.Parameters.Select(x => ResolveType(x.Type)).ToList();
|
||||
var type = new FuncTypeNode(parameters, ResolveType(function.ReturnType));
|
||||
return new FuncIdentifierNode(type, expression.Module, expression.Name, function.ExternSymbol);
|
||||
}
|
||||
|
||||
throw new TypeCheckerException(Diagnostic.Error($"No exported symbol {expression.Name} not found in module {expression.Module}").At(expression).Build());
|
||||
@@ -558,7 +562,7 @@ public sealed class TypeChecker
|
||||
result.Fields.AddRange(fields);
|
||||
|
||||
// todo(nub31): Functions and interface implementations
|
||||
|
||||
|
||||
_referencedStructTypes.Add(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user