Merge pull request #20008 from Hug0Vincent/csharp

feat: add getASupertype() predicate in ValueOrRefType.
This commit is contained in:
Michael Nebel
2025-07-16 10:39:57 +02:00
committed by GitHub
2 changed files with 7 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
---
category: feature
---
* Added a new predicate, `getASuperType()`, to get a direct supertype of this type.

View File

@@ -138,6 +138,9 @@ class ValueOrRefType extends Type, Attributable, @value_or_ref_type {
/** Gets an immediate subtype of this type, if any. */
ValueOrRefType getASubType() { result.getABaseType() = this }
/** Gets an immediate supertype of this type, if any. */
ValueOrRefType getASuperType() { this.getABaseType() = result }
/** Gets a member of this type, if any. */
Member getAMember() { result.getDeclaringType() = this }