meowlang/typechecker/types/GenericTupleTypeDescription.cs
Gwendolyn d6bdd08002 loooots of stuff
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...)
2022-02-13 02:41:16 +01:00

20 lines
586 B
C#

namespace meowlang.typechecker;
public record GenericTupleTypeDescription : GenericTypeDescription
{
private readonly List<GenericTypeId> _members;
public GenericTupleTypeDescription(List<string> genericNames, List<GenericTypeId> members) : base(genericNames)
{
_members = members;
CheckGenericNames(members);
}
public override TupleTypeDescription Concretize(List<Guid> typeParams)
{
var members = _members.Select(x => ConcretizeGenericType(x, typeParams)).ToList();
return new TupleTypeDescription(members);
}
}