d6bdd08002
the typechecker project can collect all the top level types from a file, which is pretty cool I think (except for pointers, those aren't implemented yet...)
19 lines
554 B
C#
19 lines
554 B
C#
namespace meowlang.typechecker;
|
|
|
|
public record FunctionTypeDescription : TypeDescription
|
|
{
|
|
private readonly List<TypeId> _parameters;
|
|
private readonly List<TypeId> _returns;
|
|
|
|
public FunctionTypeDescription(List<TypeId> parameters, List<TypeId> returns)
|
|
{
|
|
_parameters = parameters;
|
|
_returns = returns;
|
|
}
|
|
|
|
public IReadOnlyList<TypeId> Parameters => _parameters;
|
|
public IReadOnlyList<TypeId> Returns => _returns;
|
|
|
|
public int ParameterArity => _parameters.Count;
|
|
public int ReturnArity => _returns.Count;
|
|
} |