diff --git a/csharp/ql/lib/change-notes/2025-06-10-getasupertype.md b/csharp/ql/lib/change-notes/2025-06-10-getasupertype.md new file mode 100644 index 000000000000..14b086a94093 --- /dev/null +++ b/csharp/ql/lib/change-notes/2025-06-10-getasupertype.md @@ -0,0 +1,4 @@ +--- +category: feature +--- +* Added a new predicate, `getASuperType()`, to get a direct supertype of this type. diff --git a/csharp/ql/lib/semmle/code/csharp/Type.qll b/csharp/ql/lib/semmle/code/csharp/Type.qll index 9283bb3002a1..d11b5618e806 100644 --- a/csharp/ql/lib/semmle/code/csharp/Type.qll +++ b/csharp/ql/lib/semmle/code/csharp/Type.qll @@ -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 } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy