meowlang/typechecker/types/GenericArrayTypeDescription.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

18 lines
570 B
C#

namespace meowlang.typechecker;
public record GenericArrayTypeDescription : GenericTypeDescription
{
private readonly GenericTypeId _elementType;
private readonly uint _size;
public GenericArrayTypeDescription(List<string> genericNames, GenericTypeId elementType, uint size) : base(genericNames)
{
_elementType = elementType;
_size = size;
}
public override ArrayTypeDescription Concretize(List<Guid> typeParams)
{
return new ArrayTypeDescription(ConcretizeGenericType(_elementType, typeParams), _size);
}
}