mirror of
https://github.com/github/codeql.git
synced 2026-07-26 21:44:02 +02:00
The `enum` library test used two different queries in test-kotlin1 and
test-kotlin2, so their `.expected` files were not comparable (78 divergent lines
that reflected the query difference, not an extractor difference):
* test-kotlin1: `from Method m, RefType t where t = m.getDeclaringType() and
t.getName() = ["Enum", "Enum<?>", "Enum<E>", "EnumUserKt"]
select t.getQualifiedName(), t.getName(), m.getName()`
* test-kotlin2: `from Method m where m.getDeclaringType().getName().matches("Enum%")
select m.getName()`
The K1 query is the more precise of the two: it pins the declaring types by exact
name and reports the qualified name alongside the method, whereas the K2
`matches("Enum%")` form also pulls in unrelated `java.util.EnumSet` members as
noise. We adopt the K1 query in both suites (a pure test-input synchronisation,
no extractor change).
After unification the two suites' output is identical except for a single row:
test-kotlin2 additionally reports `kotlin.Enum | Enum | finalize`. That is a
compiler-builtin difference (the Kotlin `kotlin.Enum` built-in class exposes
`finalize` under the 2.4.0/K2 frontend but not under the 2.3.20/K1 frontend); it
is a compiler-version artifact of the built-in class member set, not something the
extractor synthesises, so it is tracked separately rather than papered over here.
All 3333 tests pass in both suites; test-kotlin1 is unchanged.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>