From bee17184694a32a12c75e3265a46b9a00af955fd Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 9 Feb 2026 16:53:43 +0100 Subject: [PATCH] QL4QL: Allow Impl classes to implement getAPrimaryQLClass with non Impl suffix. --- ql/ql/src/queries/style/GetAPrimaryQlClassConsistency.ql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ql/ql/src/queries/style/GetAPrimaryQlClassConsistency.ql b/ql/ql/src/queries/style/GetAPrimaryQlClassConsistency.ql index 00ea044ad55..2d3ab7c7d2c 100644 --- a/ql/ql/src/queries/style/GetAPrimaryQlClassConsistency.ql +++ b/ql/ql/src/queries/style/GetAPrimaryQlClassConsistency.ql @@ -16,11 +16,13 @@ import ql * * For most languages this is just the name of `c`, but QL for Swift implements * the `getAPrimaryQlClass` predicate for a class `Foo` in another class `FooBase`. + * We also allow `Impl` classes (e.g., `FooImpl`) to return `Foo`. This pattern is used + * to avoid exposing abstract classes. */ string getAnAllowedResultForClass(Class c) { result = c.getName() or - c.getName() = result + "Base" + c.getName() = result + ["Base", "Impl"] } from ClassPredicate pred, String constant, Class c