Beispiel #1
0
        internal static DirectTypeRef /*!*/ FromGenericQualifiedName(Text.Span span, GenericQualifiedName genericQualifiedName)
        {
            List <TypeRef> genericParams;

            if (genericQualifiedName.IsGeneric)
            {
                genericParams = new List <TypeRef>(genericQualifiedName.GenericParams.Length);
                foreach (var obj in genericQualifiedName.GenericParams)
                {
                    TypeRef objtype;
                    if (obj is GenericQualifiedName)
                    {
                        objtype = FromGenericQualifiedName(Text.Span.Invalid, (GenericQualifiedName)obj);
                    }
                    else if (obj is PrimitiveTypeName)
                    {
                        objtype = new PrimitiveTypeRef(Text.Span.Invalid, (PrimitiveTypeName)obj);
                    }
                    else
                    {
                        objtype = new PrimitiveTypeRef(Text.Span.Invalid, new PrimitiveTypeName(QualifiedName.Object));
                    }

                    genericParams.Add(objtype);
                }
            }
            else
            {
                //if (genericQualifiedName.QualifiedName.IsPrimitiveTypeName)
                //    return new PrimitiveTypeRef(position, new PrimitiveTypeName(genericQualifiedName.QualifiedName));

                genericParams = TypeRef.EmptyList;
            }

            return(new DirectTypeRef(span, genericQualifiedName.QualifiedName, genericParams.ToList()));
        }
Beispiel #2
0
 virtual public void VisitPrimitiveTypeRef(PrimitiveTypeRef x)
 {
     // nothing
 }