@@ -110,9 +110,16 @@ class ValueOrRefType extends DotNet::ValueOrRefType, Type, Attributable, @value_
110110 parent_namespace_declaration ( this , result )
111111 }
112112
113+ private Class getExplicitBaseClass ( ) {
114+ extend ( this , result )
115+ or
116+ not extend ( this , any ( Class c ) ) and
117+ extend ( this , getTypeRef ( result ) )
118+ }
119+
113120 /** Gets the immediate base class of this class, if any. */
114121 final Class getBaseClass ( ) {
115- extend ( this , getTypeRef ( result ) )
122+ result = this . getExplicitBaseClass ( )
116123 or
117124 not extend ( this , _) and
118125 not isObjectClass ( this ) and
@@ -122,7 +129,11 @@ class ValueOrRefType extends DotNet::ValueOrRefType, Type, Attributable, @value_
122129 }
123130
124131 /** Gets an immediate base interface of this type, if any. */
125- Interface getABaseInterface ( ) { implement ( this , getTypeRef ( result ) ) }
132+ Interface getABaseInterface ( ) {
133+ implement ( this , result )
134+ or
135+ implement ( this , getTypeRef ( result ) )
136+ }
126137
127138 /** Gets an immediate base type of this type, if any. */
128139 override ValueOrRefType getABaseType ( ) {
@@ -672,7 +683,12 @@ class Enum extends ValueType, @enum_type {
672683 * }
673684 * ```
674685 */
675- IntegralType getUnderlyingType ( ) { enum_underlying_type ( this , getTypeRef ( result ) ) }
686+ IntegralType getUnderlyingType ( ) {
687+ enum_underlying_type ( this , result )
688+ or
689+ not enum_underlying_type ( this , any ( Type t ) ) and
690+ enum_underlying_type ( this , getTypeRef ( result ) )
691+ }
676692
677693 /**
678694 * Gets an `enum` constant declared in this `enum`, for example `Even`
@@ -855,7 +871,12 @@ class Interface extends RefType, @interface_type {
855871 */
856872class DelegateType extends RefType , Parameterizable , @delegate_type {
857873 /** Gets the return type of this delegate. */
858- Type getReturnType ( ) { delegate_return_type ( this , getTypeRef ( result ) ) }
874+ Type getReturnType ( ) {
875+ delegate_return_type ( this , result )
876+ or
877+ not delegate_return_type ( this , any ( Type t ) ) and
878+ delegate_return_type ( this , getTypeRef ( result ) )
879+ }
859880
860881 /** Gets the annotated return type of this delegate. */
861882 AnnotatedType getAnnotatedReturnType ( ) { result .appliesTo ( this ) }
@@ -939,7 +960,12 @@ class UnmanagedCallingConvention extends CallingConvention {
939960 */
940961class FunctionPointerType extends Type , Parameterizable , @function_pointer_type {
941962 /** Gets the return type of this function pointer. */
942- Type getReturnType ( ) { function_pointer_return_type ( this , getTypeRef ( result ) ) }
963+ Type getReturnType ( ) {
964+ function_pointer_return_type ( this , result )
965+ or
966+ not function_pointer_return_type ( this , any ( Type t ) ) and
967+ function_pointer_return_type ( this , getTypeRef ( result ) )
968+ }
943969
944970 /** Gets the calling convention. */
945971 CallingConvention getCallingConvention ( ) {
@@ -950,6 +976,9 @@ class FunctionPointerType extends Type, Parameterizable, @function_pointer_type
950976
951977 /** Gets the unmanaged calling convention at index `i`. */
952978 Type getUnmanagedCallingConvention ( int i ) {
979+ has_unmanaged_calling_conventions ( this , i , result )
980+ or
981+ not has_unmanaged_calling_conventions ( this , i , any ( Type t ) ) and
953982 has_unmanaged_calling_conventions ( this , i , getTypeRef ( result ) )
954983 }
955984
@@ -979,7 +1008,12 @@ class NullableType extends ValueType, ConstructedType, @nullable_type {
9791008 * Gets the underlying value type of this nullable type.
9801009 * For example `int` in `int?`.
9811010 */
982- Type getUnderlyingType ( ) { nullable_underlying_type ( this , getTypeRef ( result ) ) }
1011+ Type getUnderlyingType ( ) {
1012+ nullable_underlying_type ( this , result )
1013+ or
1014+ not nullable_underlying_type ( this , any ( Type t ) ) and
1015+ nullable_underlying_type ( this , getTypeRef ( result ) )
1016+ }
9831017
9841018 override UnboundGenericStruct getUnboundGeneric ( ) {
9851019 result .hasQualifiedName ( "System" , "Nullable<>" )
@@ -1021,7 +1055,12 @@ class ArrayType extends DotNet::ArrayType, RefType, @array_type {
10211055 predicate isMultiDimensional ( ) { this .getRank ( ) > 1 }
10221056
10231057 /** Gets the element type of this array, for example `int` in `int[]`. */
1024- override Type getElementType ( ) { array_element_type ( this , _, _, getTypeRef ( result ) ) }
1058+ override Type getElementType ( ) {
1059+ array_element_type ( this , _, _, result )
1060+ or
1061+ not array_element_type ( this , _, _, any ( Type t ) ) and
1062+ array_element_type ( this , _, _, getTypeRef ( result ) )
1063+ }
10251064
10261065 /** Holds if this array type has the same shape (dimension and rank) as `that` array type. */
10271066 predicate hasSameShapeAs ( ArrayType that ) {
@@ -1076,7 +1115,12 @@ class ArrayType extends DotNet::ArrayType, RefType, @array_type {
10761115 * A pointer type, for example `char*`.
10771116 */
10781117class PointerType extends DotNet:: PointerType , Type , @pointer_type {
1079- override Type getReferentType ( ) { pointer_referent_type ( this , getTypeRef ( result ) ) }
1118+ override Type getReferentType ( ) {
1119+ pointer_referent_type ( this , result )
1120+ or
1121+ not pointer_referent_type ( this , any ( Type t ) ) and
1122+ pointer_referent_type ( this , getTypeRef ( result ) )
1123+ }
10801124
10811125 override string toStringWithTypes ( ) { result = DotNet:: PointerType .super .toStringWithTypes ( ) }
10821126
@@ -1134,7 +1178,12 @@ class UnknownType extends Type, @unknown_type {
11341178 */
11351179class TupleType extends ValueType , @tuple_type {
11361180 /** Gets the underlying type of this tuple, which is of type `System.ValueTuple`. */
1137- Struct getUnderlyingType ( ) { tuple_underlying_type ( this , getTypeRef ( result ) ) }
1181+ Struct getUnderlyingType ( ) {
1182+ tuple_underlying_type ( this , result )
1183+ or
1184+ not tuple_underlying_type ( this , any ( Type t ) ) and
1185+ tuple_underlying_type ( this , getTypeRef ( result ) )
1186+ }
11381187
11391188 /**
11401189 * Gets the `n`th element of this tuple, indexed from 0.
@@ -1196,7 +1245,11 @@ class TypeMention extends @type_mention {
11961245 Type type ;
11971246 @type_mention_parent parent ;
11981247
1199- TypeMention ( ) { type_mention ( this , getTypeRef ( type ) , parent ) }
1248+ TypeMention ( ) {
1249+ type_mention ( this , type , parent )
1250+ or
1251+ type_mention ( this , getTypeRef ( type ) , parent )
1252+ }
12001253
12011254 /** Gets the type being mentioned. */
12021255 Type getType ( ) { result = type }
0 commit comments