/// <summary> /// Is the given type a struct? /// </summary> public static bool IsStruct(this XTypeReference type) { XTypeDefinition typeDef; type = type.GetWithoutModifiers(); return(type.IsStruct(out typeDef)); }
private static bool TreatAsStruct(XTypeReference type, XTypeReference resultType) { bool isStruct = resultType.IsStruct(); bool isNullable = false; if (isStruct) { var gp = type as XGenericParameter; if (gp != null) { var typeRef = gp.Owner as XTypeReference; if (typeRef != null) isNullable = typeRef.IsSystemNullable(); } } return isStruct && !isNullable; }
/// <summary> /// Is the given type a struct? /// </summary> public static bool IsStruct(this XTypeReference type) { XTypeDefinition typeDef; return(type.IsStruct(out typeDef)); }