mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Merge pull request #11018 from smowton/smowton/fix/kotlin-extension-specialisation
Kotlin: specialise extension receivers the same as other function parameters
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
public class User {
|
||||
|
||||
public static void test(KotlinClass<String> kc) {
|
||||
|
||||
kc.getKotlinVal("Hello world");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
| User.java:5:5:5:34 | getKotlinVal(...) | getKotlinVal | String |
|
||||
| test.kt:8:43:8:78 | with(...) | with | Function1<? super T,? extends R> |
|
||||
| test.kt:8:43:8:78 | with(...) | with | T |
|
||||
| test.kt:8:68:8:76 | getKotlinVal(...) | getKotlinVal | String |
|
||||
@@ -0,0 +1,8 @@
|
||||
class KotlinClass<T> {
|
||||
|
||||
val T.kotlinVal: Int
|
||||
get() = 1
|
||||
|
||||
}
|
||||
|
||||
fun kotlinUser(kc: KotlinClass<String>) = with(kc) { "hello world".kotlinVal }
|
||||
@@ -0,0 +1,4 @@
|
||||
from create_database_utils import *
|
||||
|
||||
os.mkdir('build')
|
||||
run_codeql_database_create(["kotlinc test.kt -d build", "javac User.java -cp build"], lang="java")
|
||||
@@ -0,0 +1,4 @@
|
||||
import java
|
||||
|
||||
from MethodAccess ma
|
||||
select ma, ma.getCallee().toString(), ma.getCallee().getAParamType().toString()
|
||||
Reference in New Issue
Block a user