private class UsedTypeCollector()

in src/Refasmer/Importer/ImportLogic.cs [718:746]


    private class UsedTypeCollector(List<TypeDefinitionHandle> collectedTypes) : ISignatureVisitor<object?>
    {
        public void VisitReader(BlobReader reader) { }

        public void WriteByte(byte @byte) { }

        public void WriteCompressedInteger(int integer) { }

        public void WriteCompressedSignedInteger(int integer) { }

        public void VisitTypeHandle(EntityHandle srcHandle)
        {
            switch (srcHandle.Kind)
            {
                case HandleKind.TypeReference:
                case HandleKind.TypeSpecification:
                    break;
                case HandleKind.TypeDefinition:
                    collectedTypes.Add((TypeDefinitionHandle)srcHandle);
                    break;
                default:
                    throw new ArgumentOutOfRangeException(
                        nameof(srcHandle),
                        $"Unexpected type handle kind: {srcHandle.Kind}.");
            }
        }

        public object? GetResult() => null;
    }