mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Kotlin: Add test with extraction error due to missing base class of KFunctionX
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* This file was generated by the Gradle 'init' task.
|
||||
*
|
||||
* This generated file contains a sample Kotlin application project to get you started.
|
||||
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
|
||||
* User Manual available at https://docs.gradle.org/7.0.2/userguide/building_java_projects.html
|
||||
*/
|
||||
|
||||
plugins {
|
||||
// Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.6.20'
|
||||
|
||||
// Apply the application plugin to add support for building a CLI application in Java.
|
||||
id 'application'
|
||||
}
|
||||
|
||||
repositories {
|
||||
// Use Maven Central for resolving dependencies.
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
application {
|
||||
// Define the main class for the application.
|
||||
mainClass = 'testProject.AppKt'
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun fn() {
|
||||
val ref: KFunction2<Ccc, Int, Double> = Ccc::m
|
||||
ref.invoke(Ccc(), 1)
|
||||
}
|
||||
|
||||
class Ccc {
|
||||
fun m(i:Int):Double = 5.0
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
| app/src/main/kotlin/testProject/App.kt:0:0:0:0 | Failed to find a class declaring invoke starting at KFunction2 |
|
||||
@@ -0,0 +1,4 @@
|
||||
import java
|
||||
import semmle.code.java.Diagnostics
|
||||
|
||||
query predicate diag(Diagnostic d) { any() }
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* This file was generated by the Gradle 'init' task.
|
||||
*
|
||||
* The settings file is used to specify which projects to include in your build.
|
||||
*
|
||||
* Detailed information about configuring a multi-project build in Gradle can be found
|
||||
* in the user manual at https://docs.gradle.org/7.0.2/userguide/multi_project_builds.html
|
||||
*/
|
||||
|
||||
rootProject.name = 'testProject'
|
||||
include('app')
|
||||
@@ -0,0 +1,5 @@
|
||||
from create_database_utils import *
|
||||
|
||||
run_codeql_database_create(
|
||||
["gradle build --no-daemon --no-build-cache --rerun-tasks"], lang="java")
|
||||
runSuccessfully(["gradle", "clean"])
|
||||
Reference in New Issue
Block a user