Skip to content

Commit bf20b8e

Browse files
authored
Kotlin: Mention Literal::getLiteral() difference from source code
It appears the Kotlin extractor does not have access to the actual string representation in the source code, and for most literal types uses simply the represented value also as `getLiteral` result, see https://github.com/github/codeql/blob/codeql-cli/v2.15.1/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt#L4443
1 parent 12d0f1a commit bf20b8e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

java/ql/lib/semmle/code/java/Expr.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,9 @@ class Literal extends Expr, @literal {
530530
* Gets a string representation of this literal as it appeared
531531
* in the source code.
532532
*
533+
* For Kotlin the result might not match the exact representation
534+
* used in the source code.
535+
*
533536
* **Important:** Unless a query explicitly wants to check how
534537
* a literal was written in the source code, the predicate
535538
* `getValue()` (or value predicates of subclasses) should be

0 commit comments

Comments
 (0)