Example #1
0
        public TypeReference TypeParameter(Type type, int position, ISRImportMapper typeMapper)
        {
            for (int i = stack.Count - 1; i >= 0; i--)
            {
                var candidate = GenericTypeFor(stack[i]);

                if (candidate.FullName != NormalizedFullName(typeMapper.MapType(type)))
                    continue;

                return candidate.GenericParameters[position];
            }

            throw new InvalidOperationException();
        }