mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
Merge pull request #20008 from Hug0Vincent/csharp
feat: add getASupertype() predicate in ValueOrRefType.
This commit is contained in:
4
csharp/ql/lib/change-notes/2025-06-10-getasupertype.md
Normal file
4
csharp/ql/lib/change-notes/2025-06-10-getasupertype.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: feature
|
||||
---
|
||||
* Added a new predicate, `getASuperType()`, to get a direct supertype of this type.
|
||||
@@ -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 }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user