コード例 #1
0
        public ImmutableArray <TypeInfo> Get(IIdentity parameter)
        {
            var type   = _types.Get(parameter);
            var result = Equals(type.Only(), Check) ? Type : type;

            return(result);
        }
コード例 #2
0
        TypeInfo Generic(IIdentity parameter, ImmutableArray <Type> arguments)
        {
            var candidates = _generic.Get(_identities.Get(parameter.Name, parameter.Identifier));
            var target     = arguments.Length;

            var length = candidates.Length;

            for (var i = 0; i < length; i++)
            {
                var candidate = candidates[i];
                if (candidate.GetGenericArguments().Length == target)
                {
                    return(candidate.MakeGenericType(arguments.ToArray())
                           .GetTypeInfo());
                }
            }

            return(null);
        }