mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Kotlin: Special-case String.charAt naming
In the Kotlin universe this is called `get` so that Kotlin programmers can use the `[]` operator on `String`s.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
public class Test {
|
||||
|
||||
public char f(String s) { return s.charAt(0); }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
| Test.java:3:36:3:46 | charAt(...) |
|
||||
| test.kt:2:20:2:23 | charAt(...) |
|
||||
2
java/ql/test/kotlin/library-tests/string-charat/test.kt
Normal file
2
java/ql/test/kotlin/library-tests/string-charat/test.kt
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
fun f(x: String) = x[0]
|
||||
4
java/ql/test/kotlin/library-tests/string-charat/test.ql
Normal file
4
java/ql/test/kotlin/library-tests/string-charat/test.ql
Normal file
@@ -0,0 +1,4 @@
|
||||
import java
|
||||
|
||||
from MethodAccess ma
|
||||
select ma
|
||||
Reference in New Issue
Block a user