mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Kotlin: Add a Kotlin 2 copy of the testsuite
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
public class Test {
|
||||
|
||||
byte b;
|
||||
short s;
|
||||
int i;
|
||||
long l;
|
||||
float f;
|
||||
double d;
|
||||
|
||||
public void test(Number n, Byte b2) {
|
||||
|
||||
b = n.byteValue();
|
||||
s = n.shortValue();
|
||||
i = n.intValue();
|
||||
l = n.longValue();
|
||||
f = n.floatValue();
|
||||
d = n.doubleValue();
|
||||
b = b2.byteValue();
|
||||
s = b2.shortValue();
|
||||
i = b2.intValue();
|
||||
l = b2.longValue();
|
||||
f = b2.floatValue();
|
||||
d = b2.doubleValue();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
| java.lang.Byte | byteValue |
|
||||
| java.lang.Byte | compare |
|
||||
| java.lang.Byte | compareTo |
|
||||
| java.lang.Byte | compareUnsigned |
|
||||
| java.lang.Byte | decode |
|
||||
| java.lang.Byte | describeConstable |
|
||||
| java.lang.Byte | doubleValue |
|
||||
| java.lang.Byte | equals |
|
||||
| java.lang.Byte | floatValue |
|
||||
| java.lang.Byte | hashCode |
|
||||
| java.lang.Byte | intValue |
|
||||
| java.lang.Byte | longValue |
|
||||
| java.lang.Byte | parseByte |
|
||||
| java.lang.Byte | shortValue |
|
||||
| java.lang.Byte | toString |
|
||||
| java.lang.Byte | toUnsignedInt |
|
||||
| java.lang.Byte | toUnsignedLong |
|
||||
| java.lang.Byte | valueOf |
|
||||
| java.lang.Number | byteValue |
|
||||
| java.lang.Number | doubleValue |
|
||||
| java.lang.Number | floatValue |
|
||||
| java.lang.Number | intValue |
|
||||
| java.lang.Number | longValue |
|
||||
| java.lang.Number | shortValue |
|
||||
| kotlin.Byte | byteValue |
|
||||
| kotlin.Byte | compareTo |
|
||||
| kotlin.Byte | dec |
|
||||
| kotlin.Byte | describeConstable |
|
||||
| kotlin.Byte | div |
|
||||
| kotlin.Byte | doubleValue |
|
||||
| kotlin.Byte | equals |
|
||||
| kotlin.Byte | floatValue |
|
||||
| kotlin.Byte | inc |
|
||||
| kotlin.Byte | intValue |
|
||||
| kotlin.Byte | longValue |
|
||||
| kotlin.Byte | minus |
|
||||
| kotlin.Byte | plus |
|
||||
| kotlin.Byte | rangeTo |
|
||||
| kotlin.Byte | rangeUntil |
|
||||
| kotlin.Byte | rem |
|
||||
| kotlin.Byte | shortValue |
|
||||
| kotlin.Byte | times |
|
||||
| kotlin.Byte | toChar |
|
||||
| kotlin.Byte | toString |
|
||||
| kotlin.Byte | unaryMinus |
|
||||
| kotlin.Byte | unaryPlus |
|
||||
| kotlin.Number | byteValue |
|
||||
| kotlin.Number | doubleValue |
|
||||
| kotlin.Number | floatValue |
|
||||
| kotlin.Number | intValue |
|
||||
| kotlin.Number | longValue |
|
||||
| kotlin.Number | shortValue |
|
||||
| kotlin.Number | toChar |
|
||||
@@ -0,0 +1,8 @@
|
||||
fun f(n: Number, b: Byte) = n.toByte() + n.toShort() + n.toInt() + n.toLong() + n.toFloat() + n.toDouble() + b.toByte() + b.toShort() + b.toInt() + b.toLong() + b.toFloat() + b.toDouble()
|
||||
|
||||
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Byte.toByte in java.lang.Byte ...while extracting a call (<no name>) at %test.kt:1:112:1:119%
|
||||
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Byte.toDouble in java.lang.Byte ...while extracting a call (<no name>) at %test.kt:1:178:1:187%
|
||||
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Byte.toFloat in java.lang.Byte ...while extracting a call (<no name>) at %test.kt:1:164:1:172%
|
||||
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Byte.toInt in java.lang.Byte ...while extracting a call (<no name>) at %test.kt:1:139:1:145%
|
||||
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Byte.toLong in java.lang.Byte ...while extracting a call (<no name>) at %test.kt:1:151:1:158%
|
||||
// Diagnostic Matches: % Couldn't find a Java equivalent function to kotlin.Byte.toShort in java.lang.Byte ...while extracting a call (<no name>) at %test.kt:1:125:1:133%
|
||||
@@ -0,0 +1,5 @@
|
||||
import java
|
||||
|
||||
from Method m
|
||||
where m.getDeclaringType().getName() = ["Number", "Byte"]
|
||||
select m.getDeclaringType().getQualifiedName(), m.toString()
|
||||
Reference in New Issue
Block a user