[FIR TEST]: add problematic test for T::class.java case

This commit is contained in:
Mikhail Glukhikh
2019-12-16 15:21:27 +03:00
parent 38b0de4ab6
commit ccb9a4e0a9
3 changed files with 14 additions and 0 deletions
@@ -0,0 +1,4 @@
inline fun <reified T : Any> foo(t: T): T {
val klass = <!OTHER_ERROR!>T<!>::class.<!INAPPLICABLE_CANDIDATE!>java<!>
return t
}
@@ -0,0 +1,5 @@
FILE: classLiteralForParameter.kt
public final inline fun <reified T : R|kotlin/Any|> foo(t: R|T|): R|T| {
lval klass: <ERROR TYPE REF: Inapplicable(WRONG_RECEIVER): [kotlin/jvm/java]> = <getClass>(R|?|).<Inapplicable(WRONG_RECEIVER): [kotlin/jvm/java]>#
^foo R|<local>/t|
}
@@ -582,6 +582,11 @@ public class FirDiagnosticsWithStdlibTestGenerated extends AbstractFirDiagnostic
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/resolve/testData/resolve/stdlib/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@TestMetadata("classLiteralForParameter.kt")
public void testClassLiteralForParameter() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/stdlib/problems/classLiteralForParameter.kt");
}
@TestMetadata("cloneArray.kt")
public void testCloneArray() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/stdlib/problems/cloneArray.kt");