From fb693837e4ded37bc66bb4c975383c61ebf9aa77 Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 10 Jul 2025 02:19:17 +0200 Subject: [PATCH 1/4] feat: add getASupertype() predicate in ValueOrRefType. Add the getASupertype() predicate in ValueOrRefType. --- csharp/ql/lib/semmle/code/csharp/Type.qll | 3 +++ 1 file changed, 3 insertions(+) diff --git a/csharp/ql/lib/semmle/code/csharp/Type.qll b/csharp/ql/lib/semmle/code/csharp/Type.qll index 9283bb3002a1..3693e8977d89 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 } From c3c8d5db134582064ac367552980d27a8167b848 Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 10 Jul 2025 05:48:52 +0200 Subject: [PATCH 2/4] Create 2025-06-10-getasupertype.md Create 2025-06-10-getasupertype.md --- csharp/ql/lib/change-notes/2025-06-10-getasupertype.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 csharp/ql/lib/change-notes/2025-06-10-getasupertype.md 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..8f91b2d3cc5b --- /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. From 6384cf2e4f2856d5b0e383d69ebca1cd59d35ecb Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 16 Jul 2025 00:35:14 +0200 Subject: [PATCH 3/4] Update predicate name --- csharp/ql/lib/semmle/code/csharp/Type.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/ql/lib/semmle/code/csharp/Type.qll b/csharp/ql/lib/semmle/code/csharp/Type.qll index 3693e8977d89..d11b5618e806 100644 --- a/csharp/ql/lib/semmle/code/csharp/Type.qll +++ b/csharp/ql/lib/semmle/code/csharp/Type.qll @@ -139,7 +139,7 @@ class ValueOrRefType extends Type, Attributable, @value_or_ref_type { ValueOrRefType getASubType() { result.getABaseType() = this } /** Gets an immediate supertype of this type, if any. */ - ValueOrRefType getASupertype() { this.getABaseType() = result } + ValueOrRefType getASuperType() { this.getABaseType() = result } /** Gets a member of this type, if any. */ Member getAMember() { result.getDeclaringType() = this } From 8c82405b5b42233ff554442ceddb4106924be567 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 16 Jul 2025 00:35:30 +0200 Subject: [PATCH 4/4] Update 2025-06-10-getasupertype.md --- csharp/ql/lib/change-notes/2025-06-10-getasupertype.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/ql/lib/change-notes/2025-06-10-getasupertype.md b/csharp/ql/lib/change-notes/2025-06-10-getasupertype.md index 8f91b2d3cc5b..14b086a94093 100644 --- a/csharp/ql/lib/change-notes/2025-06-10-getasupertype.md +++ b/csharp/ql/lib/change-notes/2025-06-10-getasupertype.md @@ -1,4 +1,4 @@ --- category: feature --- -* Added a new predicate, `getASupertype()`, to get a direct supertype of this type. +* Added a new predicate, `getASuperType()`, to get a direct supertype of this type.