Tests: references to private/internal primary val of inline class
This commit is contained in:
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
inline class Z(internal val x: Int)
|
||||
inline class L(internal val x: Long)
|
||||
inline class S(internal val x: String)
|
||||
|
||||
fun box(): String {
|
||||
assertEquals(42, Z::x.get(Z(42)))
|
||||
assertEquals(1234L, L::x.get(L(1234L)))
|
||||
assertEquals("abc", S::x.get(S("abc")))
|
||||
|
||||
assertEquals(42, Z::x.invoke(Z(42)))
|
||||
assertEquals(1234L, L::x.invoke(L(1234L)))
|
||||
assertEquals("abc", S::x.invoke(S("abc")))
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
inline class Z(private val x: Int) {
|
||||
companion object {
|
||||
val xref = Z::x
|
||||
}
|
||||
}
|
||||
|
||||
inline class L(private val x: Long) {
|
||||
companion object {
|
||||
val xref = L::x
|
||||
}
|
||||
}
|
||||
|
||||
inline class S(private val x: String) {
|
||||
companion object {
|
||||
val xref = S::x
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
assertEquals(42, Z.xref.get(Z(42)))
|
||||
assertEquals(1234L, L.xref.get(L(1234L)))
|
||||
assertEquals("abc", S.xref.get(S("abc")))
|
||||
|
||||
assertEquals(42, Z.xref.invoke(Z(42)))
|
||||
assertEquals(1234L, L.xref.invoke(L(1234L)))
|
||||
assertEquals("abc", S.xref.invoke(S("abc")))
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+10
@@ -12081,6 +12081,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassInternalPrimaryVal.kt")
|
||||
public void testInlineClassInternalPrimaryVal() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassMemberFun.kt")
|
||||
public void testInlineClassMemberFun() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt");
|
||||
@@ -12101,6 +12106,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassPrivatePrimaryVal.kt")
|
||||
public void testInlineClassPrivatePrimaryVal() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassTypeBoundMemberVar.kt")
|
||||
public void testInlineClassTypeBoundMemberVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt");
|
||||
|
||||
+10
@@ -12081,6 +12081,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassInternalPrimaryVal.kt")
|
||||
public void testInlineClassInternalPrimaryVal() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassMemberFun.kt")
|
||||
public void testInlineClassMemberFun() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt");
|
||||
@@ -12101,6 +12106,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassPrivatePrimaryVal.kt")
|
||||
public void testInlineClassPrivatePrimaryVal() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassTypeBoundMemberVar.kt")
|
||||
public void testInlineClassTypeBoundMemberVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt");
|
||||
|
||||
+10
@@ -12086,6 +12086,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassInternalPrimaryVal.kt")
|
||||
public void testInlineClassInternalPrimaryVal() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassMemberFun.kt")
|
||||
public void testInlineClassMemberFun() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt");
|
||||
@@ -12106,6 +12111,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassPrivatePrimaryVal.kt")
|
||||
public void testInlineClassPrivatePrimaryVal() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassTypeBoundMemberVar.kt")
|
||||
public void testInlineClassTypeBoundMemberVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt");
|
||||
|
||||
+10
@@ -10601,6 +10601,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassInternalPrimaryVal.kt")
|
||||
public void testInlineClassInternalPrimaryVal() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassMemberFun.kt")
|
||||
public void testInlineClassMemberFun() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt");
|
||||
@@ -10621,6 +10626,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassPrivatePrimaryVal.kt")
|
||||
public void testInlineClassPrivatePrimaryVal() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassTypeBoundMemberVar.kt")
|
||||
public void testInlineClassTypeBoundMemberVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt");
|
||||
|
||||
+10
@@ -11646,6 +11646,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassExtensionVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassInternalPrimaryVal.kt")
|
||||
public void testInlineClassInternalPrimaryVal() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassInternalPrimaryVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassMemberFun.kt")
|
||||
public void testInlineClassMemberFun() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassMemberFun.kt");
|
||||
@@ -11666,6 +11671,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrimaryVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassPrivatePrimaryVal.kt")
|
||||
public void testInlineClassPrivatePrimaryVal() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassPrivatePrimaryVal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineClassTypeBoundMemberVar.kt")
|
||||
public void testInlineClassTypeBoundMemberVar() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/callableReferences/inlineClassTypeBoundMemberVar.kt");
|
||||
|
||||
Reference in New Issue
Block a user