示例#1
0
        public CapnpType ResolveGenericParameter(CapnpGenericParameter parameter)
        {
            var genericOpenType = OpenType as CapnpGenericType;
            var index           = genericOpenType == null ? -2 : Array.IndexOf(genericOpenType.TypeParameters, parameter);

            if (index < 0)
            {
                return(ParentScope == null ? null : ParentScope.ResolveGenericParameter(parameter));
            }
            var result = TypeParameters[index];

            if (result is CapnpGenericParameter && ParentScope != null)
            {
                return(ParentScope.ResolveGenericParameter((CapnpGenericParameter)result));
            }
            return(result);
        }
示例#2
0
 protected internal virtual CapnpGenericParameter VisitGenericParameter(CapnpGenericParameter @param)
 {
     return(@param);
 }