K2: add some more tests around KT-63377 and KT-58028

This commit is contained in:
Mikhail Glukhikh
2023-11-23 14:05:47 +01:00
committed by Space Team
parent 99234ef1c5
commit 4e938d852c
16 changed files with 594 additions and 30 deletions
@@ -30478,12 +30478,6 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/resolve/capturedTypesInLambdaParameter.kt");
}
@Test
@TestMetadata("companionPropertyAndTypeParameter.kt")
public void testCompanionPropertyAndTypeParameter() throws Exception {
runTest("compiler/testData/diagnostics/tests/resolve/companionPropertyAndTypeParameter.kt");
}
@Test
@TestMetadata("constructorVsCompanion.kt")
public void testConstructorVsCompanion() throws Exception {
@@ -37374,6 +37368,18 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/typeParameters/cannotHaveManyClassUpperBounds.kt");
}
@Test
@TestMetadata("companionPropertyAndTypeParameter.kt")
public void testCompanionPropertyAndTypeParameter() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/companionPropertyAndTypeParameter.kt");
}
@Test
@TestMetadata("companionPropertyAndTypeParameter2.kt")
public void testCompanionPropertyAndTypeParameter2() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/companionPropertyAndTypeParameter2.kt");
}
@Test
@TestMetadata("deprecatedSyntax.kt")
public void testDeprecatedSyntax() throws Exception {
@@ -37482,6 +37488,18 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/typeParameters/memberTypeParameterVsNestedClass.kt");
}
@Test
@TestMetadata("memberTypeParameterVsNestedClass2.kt")
public void testMemberTypeParameterVsNestedClass2() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/memberTypeParameterVsNestedClass2.kt");
}
@Test
@TestMetadata("memberTypeParameterVsNestedClassReference.kt")
public void testMemberTypeParameterVsNestedClassReference() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/memberTypeParameterVsNestedClassReference.kt");
}
@Test
@TestMetadata("misplacedConstraints.kt")
public void testMisplacedConstraints() throws Exception {
@@ -30478,12 +30478,6 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/resolve/capturedTypesInLambdaParameter.kt");
}
@Test
@TestMetadata("companionPropertyAndTypeParameter.kt")
public void testCompanionPropertyAndTypeParameter() throws Exception {
runTest("compiler/testData/diagnostics/tests/resolve/companionPropertyAndTypeParameter.kt");
}
@Test
@TestMetadata("constructorVsCompanion.kt")
public void testConstructorVsCompanion() throws Exception {
@@ -37374,6 +37368,18 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/typeParameters/cannotHaveManyClassUpperBounds.kt");
}
@Test
@TestMetadata("companionPropertyAndTypeParameter.kt")
public void testCompanionPropertyAndTypeParameter() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/companionPropertyAndTypeParameter.kt");
}
@Test
@TestMetadata("companionPropertyAndTypeParameter2.kt")
public void testCompanionPropertyAndTypeParameter2() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/companionPropertyAndTypeParameter2.kt");
}
@Test
@TestMetadata("deprecatedSyntax.kt")
public void testDeprecatedSyntax() throws Exception {
@@ -37482,6 +37488,18 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/typeParameters/memberTypeParameterVsNestedClass.kt");
}
@Test
@TestMetadata("memberTypeParameterVsNestedClass2.kt")
public void testMemberTypeParameterVsNestedClass2() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/memberTypeParameterVsNestedClass2.kt");
}
@Test
@TestMetadata("memberTypeParameterVsNestedClassReference.kt")
public void testMemberTypeParameterVsNestedClassReference() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/memberTypeParameterVsNestedClassReference.kt");
}
@Test
@TestMetadata("misplacedConstraints.kt")
public void testMisplacedConstraints() throws Exception {
@@ -28460,12 +28460,6 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/resolve/capturedTypesInLambdaParameter.kt");
}
@Test
@TestMetadata("companionPropertyAndTypeParameter.kt")
public void testCompanionPropertyAndTypeParameter() throws Exception {
runTest("compiler/testData/diagnostics/tests/resolve/companionPropertyAndTypeParameter.kt");
}
@Test
@TestMetadata("constructorVsCompanion.kt")
public void testConstructorVsCompanion() throws Exception {
@@ -35248,6 +35242,18 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/typeParameters/cannotHaveManyClassUpperBounds.kt");
}
@Test
@TestMetadata("companionPropertyAndTypeParameter.kt")
public void testCompanionPropertyAndTypeParameter() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/companionPropertyAndTypeParameter.kt");
}
@Test
@TestMetadata("companionPropertyAndTypeParameter2.kt")
public void testCompanionPropertyAndTypeParameter2() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/companionPropertyAndTypeParameter2.kt");
}
@Test
@TestMetadata("deprecatedSyntax.kt")
public void testDeprecatedSyntax() throws Exception {
@@ -35356,6 +35362,18 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/typeParameters/memberTypeParameterVsNestedClass.kt");
}
@Test
@TestMetadata("memberTypeParameterVsNestedClass2.kt")
public void testMemberTypeParameterVsNestedClass2() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/memberTypeParameterVsNestedClass2.kt");
}
@Test
@TestMetadata("memberTypeParameterVsNestedClassReference.kt")
public void testMemberTypeParameterVsNestedClassReference() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/memberTypeParameterVsNestedClassReference.kt");
}
@Test
@TestMetadata("misplacedConstraints.kt")
public void testMisplacedConstraints() throws Exception {
@@ -28472,12 +28472,6 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/resolve/capturedTypesInLambdaParameter.kt");
}
@Test
@TestMetadata("companionPropertyAndTypeParameter.kt")
public void testCompanionPropertyAndTypeParameter() throws Exception {
runTest("compiler/testData/diagnostics/tests/resolve/companionPropertyAndTypeParameter.kt");
}
@Test
@TestMetadata("constructorVsCompanion.kt")
public void testConstructorVsCompanion() throws Exception {
@@ -35368,6 +35362,18 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/typeParameters/cannotHaveManyClassUpperBounds.kt");
}
@Test
@TestMetadata("companionPropertyAndTypeParameter.kt")
public void testCompanionPropertyAndTypeParameter() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/companionPropertyAndTypeParameter.kt");
}
@Test
@TestMetadata("companionPropertyAndTypeParameter2.kt")
public void testCompanionPropertyAndTypeParameter2() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/companionPropertyAndTypeParameter2.kt");
}
@Test
@TestMetadata("deprecatedSyntax.kt")
public void testDeprecatedSyntax() throws Exception {
@@ -35476,6 +35482,18 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/typeParameters/memberTypeParameterVsNestedClass.kt");
}
@Test
@TestMetadata("memberTypeParameterVsNestedClass2.kt")
public void testMemberTypeParameterVsNestedClass2() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/memberTypeParameterVsNestedClass2.kt");
}
@Test
@TestMetadata("memberTypeParameterVsNestedClassReference.kt")
public void testMemberTypeParameterVsNestedClassReference() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/memberTypeParameterVsNestedClassReference.kt");
}
@Test
@TestMetadata("misplacedConstraints.kt")
public void testMisplacedConstraints() throws Exception {
@@ -0,0 +1,101 @@
FILE: companionPropertyAndTypeParameter.kt
public open class Base : R|kotlin/Any| {
public constructor(any: R|kotlin/Any|): R|Base| {
super<R|kotlin/Any|>()
}
public final companion object Companion : R|kotlin/Any| {
private constructor(): R|Base.Companion| {
super<R|kotlin/Any|>()
}
public final val test: R|kotlin/Long| = Long(42)
public get(): R|kotlin/Long|
}
}
public final class C1<test> : R|Base| {
public constructor<test>(): R|C1<test>| {
super<R|Base|>(this@R|/C1.Companion|.R|/C1.Companion.test|)
}
public final companion object Companion : R|kotlin/Any| {
private constructor(): R|C1.Companion| {
super<R|kotlin/Any|>()
}
public final val test: R|kotlin/Int| = Int(12)
public get(): R|kotlin/Int|
public final val some: R|kotlin/Int| = this@R|/C1.Companion|.R|/C1.Companion.test|
public get(): R|kotlin/Int|
}
public final val test: R|kotlin/String| = String()
public get(): R|kotlin/String|
public final val some: R|kotlin/String| = this@R|/C1|.R|/C1.test|
public get(): R|kotlin/String|
public final fun f(): R|kotlin/Unit| {
lval test: R|kotlin/Double| = Double(1.0)
lval some: R|kotlin/Double| = R|<local>/test|
}
}
public final class C2<test> : R|Base| {
public constructor<test>(): R|C2<test>| {
super<R|Base|>(this@R|/C2.Companion|.R|/C2.Companion.test|)
}
public final companion object Companion : R|kotlin/Any| {
private constructor(): R|C2.Companion| {
super<R|kotlin/Any|>()
}
public final val test: R|kotlin/Int| = Int(12)
public get(): R|kotlin/Int|
public final val some: R|kotlin/Int| = this@R|/C2.Companion|.R|/C2.Companion.test|
public get(): R|kotlin/Int|
}
public final val some: R|kotlin/Int| = this@R|/C2.Companion|.R|/C2.Companion.test|
public get(): R|kotlin/Int|
public final fun f(): R|kotlin/Unit| {
lval test: R|kotlin/Double| = Double(1.0)
lval some: R|kotlin/Double| = R|<local>/test|
}
}
public final class C3<test> : R|Base| {
public constructor<test>(): R|C3<test>| {
super<R|Base|>(this@R|/Base.Companion|.R|/Base.Companion.test|)
}
public final val some: R|kotlin/Long| = this@R|/Base.Companion|.R|/Base.Companion.test|
public get(): R|kotlin/Long|
public final fun f(): R|kotlin/Unit| {
lval test: R|kotlin/Double| = Double(1.0)
lval some: R|kotlin/Double| = R|<local>/test|
}
}
public final class C4<test> : R|kotlin/Any| {
public constructor<test>(): R|C4<test>| {
super<R|kotlin/Any|>()
}
public final val some: <ERROR TYPE REF: Type parameter test in qualified access> = R|?|
public get(): <ERROR TYPE REF: Type parameter test in qualified access>
public final fun f(): R|kotlin/Unit| {
lval some: <ERROR TYPE REF: Type parameter test in qualified access> = R|?|
}
}
@@ -1,4 +1,6 @@
// FIR_IDENTICAL
// ISSUE: KT-58028
// FIR_DUMP
// DIAGNOSTICS: -UNUSED_VARIABLE
open class Base(any: Any) {
@@ -0,0 +1,16 @@
// ISSUE: KT-58028, KT-63377
// FIR_DUMP
class Owner<test> {
companion object {
val test = 12
}
inner class I<test> {
val some = <!TYPE_PARAMETER_IS_NOT_AN_EXPRESSION!>test<!>
fun foo() {
val some = <!TYPE_PARAMETER_IS_NOT_AN_EXPRESSION!>test<!>
}
}
}
@@ -0,0 +1,31 @@
FILE: companionPropertyAndTypeParameter2.fir.kt
public final class Owner<test> : R|kotlin/Any| {
public constructor<test>(): R|Owner<test>| {
super<R|kotlin/Any|>()
}
public final companion object Companion : R|kotlin/Any| {
private constructor(): R|Owner.Companion| {
super<R|kotlin/Any|>()
}
public final val test: R|kotlin/Int| = Int(12)
public get(): R|kotlin/Int|
}
public final inner class I<test, Outer(test)> : R|kotlin/Any| {
public Owner<test>.constructor<test>(): R|Owner.I<test, test>| {
super<R|kotlin/Any|>()
}
public final val some: <ERROR TYPE REF: Type parameter test in qualified access> = R|?|
public get(): <ERROR TYPE REF: Type parameter test in qualified access>
public final fun foo(): R|kotlin/Unit| {
lval some: <ERROR TYPE REF: Type parameter test in qualified access> = R|?|
}
}
}
@@ -0,0 +1,16 @@
// ISSUE: KT-58028, KT-63377
// FIR_DUMP
class Owner<test> {
companion object {
val test = 12
}
inner class I<test> {
val some = test
fun foo() {
val some = test
}
}
}
@@ -0,0 +1,28 @@
// ISSUE: KT-63377
// FIR_DUMP
class Outer {
class T
inline fun <reified T> foo() {
T::class
val x: T? = null
val y: T? = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>T()<!>
}
fun <T> bar() {
<!TYPE_PARAMETER_AS_REIFIED!>T::class<!>
val x: T? = null
val y: T? = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>T()<!>
}
}
class Owner<T> {
class T
fun baz() {
<!TYPE_PARAMETER_AS_REIFIED!>T::class<!>
val x: T? = null
val y: T? = T()
}
}
@@ -0,0 +1,45 @@
FILE: memberTypeParameterVsNestedClass2.fir.kt
public final class Outer : R|kotlin/Any| {
public constructor(): R|Outer| {
super<R|kotlin/Any|>()
}
public final class T : R|kotlin/Any| {
public constructor(): R|Outer.T| {
super<R|kotlin/Any|>()
}
}
public final inline fun <reified T> foo(): R|kotlin/Unit| {
<getClass>(R|T|)
lval x: R|T?| = Null(null)
lval y: R|T?| = R|/Outer.T.T<CS errors: /Outer.T.T>#|()
}
public final fun <T> bar(): R|kotlin/Unit| {
<getClass>(R|?|)
lval x: R|T?| = Null(null)
lval y: R|T?| = R|/Outer.T.T<CS errors: /Outer.T.T>#|()
}
}
public final class Owner<T> : R|kotlin/Any| {
public constructor<T>(): R|Owner<T>| {
super<R|kotlin/Any|>()
}
public final class T : R|kotlin/Any| {
public constructor(): R|Owner.T| {
super<R|kotlin/Any|>()
}
}
public final fun baz(): R|kotlin/Unit| {
<getClass>(R|?|)
lval x: R|Owner.T?| = Null(null)
lval y: R|Owner.T?| = R|/Owner.T.T|()
}
}
@@ -0,0 +1,28 @@
// ISSUE: KT-63377
// FIR_DUMP
class Outer {
class T
inline fun <reified T> foo() {
T::class
val x: T? = null
val y: T? = <!TYPE_MISMATCH!>T()<!>
}
fun <T> bar() {
<!TYPE_PARAMETER_AS_REIFIED!>T::class<!>
val x: T? = null
val y: T? = <!TYPE_MISMATCH!>T()<!>
}
}
class Owner<T> {
class T
fun baz() {
<!TYPE_PARAMETER_AS_REIFIED!>T::class<!>
val x: T? = null
val y: T? = <!TYPE_MISMATCH!>T()<!>
}
}
@@ -0,0 +1,54 @@
// ISSUE: KT-63377
// FIR_DUMP
class OuterClassWithObject<OuterParam> {
object OuterParam {
fun foo() {}
}
val k = ::<!UNRESOLVED_REFERENCE!>OuterParam<!>
val l = OuterParam::foo
fun foo() {
val k = ::<!UNRESOLVED_REFERENCE!>OuterParam<!>
val l = OuterParam::foo
}
inner class Inner<NestedParam : OuterParam>(t: NestedParam) {
val k = ::<!UNRESOLVED_REFERENCE!>OuterParam<!>
val l = OuterParam::foo
init {
val k = ::<!UNRESOLVED_REFERENCE!>OuterParam<!>
val l = OuterParam::foo
}
}
}
class OuterClassWithClass<OuterParam> {
class OuterParam {
fun foo() {}
}
val k = ::OuterParam
val l = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>OuterParam::<!UNRESOLVED_REFERENCE!>foo<!><!>
val m = OuterParam()::foo
fun foo() {
val k = ::OuterParam
val l = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>OuterParam::<!UNRESOLVED_REFERENCE!>foo<!><!>
val m = OuterParam()::foo
}
inner class Inner<NestedParam : OuterParam>(t: NestedParam) {
val k = ::OuterParam
val l = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>OuterParam::<!UNRESOLVED_REFERENCE!>foo<!><!>
val m = OuterParam()::foo
init {
val k = ::OuterParam
val l = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>OuterParam::<!UNRESOLVED_REFERENCE!>foo<!><!>
val m = OuterParam()::foo
}
}
}
@@ -0,0 +1,99 @@
FILE: memberTypeParameterVsNestedClassReference.fir.kt
public final class OuterClassWithObject<OuterParam> : R|kotlin/Any| {
public constructor<OuterParam>(): R|OuterClassWithObject<OuterParam>| {
super<R|kotlin/Any|>()
}
public final object OuterParam : R|kotlin/Any| {
private constructor(): R|OuterClassWithObject.OuterParam| {
super<R|kotlin/Any|>()
}
public final fun foo(): R|kotlin/Unit| {
}
}
public final val k: <ERROR TYPE REF: HIDDEN: /OuterClassWithObject.OuterParam.OuterParam is deprecated with DeprecationLevel.HIDDEN> = ::<HIDDEN: /OuterClassWithObject.OuterParam.OuterParam is deprecated with DeprecationLevel.HIDDEN>#
public get(): <ERROR TYPE REF: HIDDEN: /OuterClassWithObject.OuterParam.OuterParam is deprecated with DeprecationLevel.HIDDEN>
public final val l: R|kotlin/reflect/KFunction0<kotlin/Unit>| = Q|OuterClassWithObject.OuterParam|::R|/OuterClassWithObject.OuterParam.foo|
public get(): R|kotlin/reflect/KFunction0<kotlin/Unit>|
public final fun foo(): R|kotlin/Unit| {
lval k: <ERROR TYPE REF: HIDDEN: /OuterClassWithObject.OuterParam.OuterParam is deprecated with DeprecationLevel.HIDDEN> = ::<HIDDEN: /OuterClassWithObject.OuterParam.OuterParam is deprecated with DeprecationLevel.HIDDEN>#
lval l: R|kotlin/reflect/KFunction0<kotlin/Unit>| = Q|OuterClassWithObject.OuterParam|::R|/OuterClassWithObject.OuterParam.foo|
}
public final inner class Inner<NestedParam : R|OuterParam|, Outer(OuterParam)> : R|kotlin/Any| {
public OuterClassWithObject<OuterParam>.constructor<NestedParam : R|OuterParam|>(t: R|NestedParam|): R|OuterClassWithObject.Inner<NestedParam, OuterParam>| {
super<R|kotlin/Any|>()
}
public final val k: <ERROR TYPE REF: HIDDEN: /OuterClassWithObject.OuterParam.OuterParam is deprecated with DeprecationLevel.HIDDEN> = ::<HIDDEN: /OuterClassWithObject.OuterParam.OuterParam is deprecated with DeprecationLevel.HIDDEN>#
public get(): <ERROR TYPE REF: HIDDEN: /OuterClassWithObject.OuterParam.OuterParam is deprecated with DeprecationLevel.HIDDEN>
public final val l: R|kotlin/reflect/KFunction0<kotlin/Unit>| = Q|OuterClassWithObject.OuterParam|::R|/OuterClassWithObject.OuterParam.foo|
public get(): R|kotlin/reflect/KFunction0<kotlin/Unit>|
init {
lval k: <ERROR TYPE REF: HIDDEN: /OuterClassWithObject.OuterParam.OuterParam is deprecated with DeprecationLevel.HIDDEN> = ::<HIDDEN: /OuterClassWithObject.OuterParam.OuterParam is deprecated with DeprecationLevel.HIDDEN>#
lval l: R|kotlin/reflect/KFunction0<kotlin/Unit>| = Q|OuterClassWithObject.OuterParam|::R|/OuterClassWithObject.OuterParam.foo|
}
}
}
public final class OuterClassWithClass<OuterParam> : R|kotlin/Any| {
public constructor<OuterParam>(): R|OuterClassWithClass<OuterParam>| {
super<R|kotlin/Any|>()
}
public final class OuterParam : R|kotlin/Any| {
public constructor(): R|OuterClassWithClass.OuterParam| {
super<R|kotlin/Any|>()
}
public final fun foo(): R|kotlin/Unit| {
}
}
public final val k: R|kotlin/reflect/KFunction0<OuterClassWithClass.OuterParam>| = ::R|/OuterClassWithClass.OuterParam.OuterParam|
public get(): R|kotlin/reflect/KFunction0<OuterClassWithClass.OuterParam>|
public final val l: <ERROR TYPE REF: Unresolved reference: foo> = R|?|::<Unresolved reference: foo>#
public get(): <ERROR TYPE REF: Unresolved reference: foo>
public final val m: R|kotlin/reflect/KFunction0<kotlin/Unit>| = R|/OuterClassWithClass.OuterParam.OuterParam|()::R|/OuterClassWithClass.OuterParam.foo|
public get(): R|kotlin/reflect/KFunction0<kotlin/Unit>|
public final fun foo(): R|kotlin/Unit| {
lval k: R|kotlin/reflect/KFunction0<OuterClassWithClass.OuterParam>| = ::R|/OuterClassWithClass.OuterParam.OuterParam|
lval l: <ERROR TYPE REF: Unresolved reference: foo> = R|?|::<Unresolved reference: foo>#
lval m: R|kotlin/reflect/KFunction0<kotlin/Unit>| = R|/OuterClassWithClass.OuterParam.OuterParam|()::R|/OuterClassWithClass.OuterParam.foo|
}
public final inner class Inner<NestedParam : R|OuterParam|, Outer(OuterParam)> : R|kotlin/Any| {
public OuterClassWithClass<OuterParam>.constructor<NestedParam : R|OuterParam|>(t: R|NestedParam|): R|OuterClassWithClass.Inner<NestedParam, OuterParam>| {
super<R|kotlin/Any|>()
}
public final val k: R|kotlin/reflect/KFunction0<OuterClassWithClass.OuterParam>| = ::R|/OuterClassWithClass.OuterParam.OuterParam|
public get(): R|kotlin/reflect/KFunction0<OuterClassWithClass.OuterParam>|
public final val l: <ERROR TYPE REF: Unresolved reference: foo> = R|?|::<Unresolved reference: foo>#
public get(): <ERROR TYPE REF: Unresolved reference: foo>
public final val m: R|kotlin/reflect/KFunction0<kotlin/Unit>| = R|/OuterClassWithClass.OuterParam.OuterParam|()::R|/OuterClassWithClass.OuterParam.foo|
public get(): R|kotlin/reflect/KFunction0<kotlin/Unit>|
init {
lval k: R|kotlin/reflect/KFunction0<OuterClassWithClass.OuterParam>| = ::R|/OuterClassWithClass.OuterParam.OuterParam|
lval l: <ERROR TYPE REF: Unresolved reference: foo> = R|?|::<Unresolved reference: foo>#
lval m: R|kotlin/reflect/KFunction0<kotlin/Unit>| = R|/OuterClassWithClass.OuterParam.OuterParam|()::R|/OuterClassWithClass.OuterParam.foo|
}
}
}
@@ -0,0 +1,54 @@
// ISSUE: KT-63377
// FIR_DUMP
class OuterClassWithObject<OuterParam> {
object OuterParam {
fun foo() {}
}
val k = ::<!UNRESOLVED_REFERENCE!>OuterParam<!>
val l = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>OuterParam::<!UNRESOLVED_REFERENCE!>foo<!><!>
fun foo() {
val k = ::<!UNRESOLVED_REFERENCE!>OuterParam<!>
val l = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>OuterParam::<!UNRESOLVED_REFERENCE!>foo<!><!>
}
inner class Inner<NestedParam : OuterParam>(t: NestedParam) {
val k = ::<!UNRESOLVED_REFERENCE!>OuterParam<!>
val l = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>OuterParam::<!UNRESOLVED_REFERENCE!>foo<!><!>
init {
val k = ::<!UNRESOLVED_REFERENCE!>OuterParam<!>
val l = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>OuterParam::<!UNRESOLVED_REFERENCE!>foo<!><!>
}
}
}
class OuterClassWithClass<OuterParam> {
class OuterParam {
fun foo() {}
}
val k = ::OuterParam
val l = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>OuterParam::<!UNRESOLVED_REFERENCE!>foo<!><!>
val m = OuterParam()::foo
fun foo() {
val k = ::OuterParam
val l = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>OuterParam::<!UNRESOLVED_REFERENCE!>foo<!><!>
val m = OuterParam()::foo
}
inner class Inner<NestedParam : OuterParam>(t: NestedParam) {
val k = ::OuterParam
val l = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>OuterParam::<!UNRESOLVED_REFERENCE!>foo<!><!>
val m = OuterParam()::foo
init {
val k = ::OuterParam
val l = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>OuterParam::<!UNRESOLVED_REFERENCE!>foo<!><!>
val m = OuterParam()::foo
}
}
}
@@ -30478,12 +30478,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/resolve/capturedTypesInLambdaParameter.kt");
}
@Test
@TestMetadata("companionPropertyAndTypeParameter.kt")
public void testCompanionPropertyAndTypeParameter() throws Exception {
runTest("compiler/testData/diagnostics/tests/resolve/companionPropertyAndTypeParameter.kt");
}
@Test
@TestMetadata("constructorVsCompanion.kt")
public void testConstructorVsCompanion() throws Exception {
@@ -37374,6 +37368,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/typeParameters/cannotHaveManyClassUpperBounds.kt");
}
@Test
@TestMetadata("companionPropertyAndTypeParameter.kt")
public void testCompanionPropertyAndTypeParameter() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/companionPropertyAndTypeParameter.kt");
}
@Test
@TestMetadata("companionPropertyAndTypeParameter2.kt")
public void testCompanionPropertyAndTypeParameter2() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/companionPropertyAndTypeParameter2.kt");
}
@Test
@TestMetadata("deprecatedSyntax.kt")
public void testDeprecatedSyntax() throws Exception {
@@ -37482,6 +37488,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/typeParameters/memberTypeParameterVsNestedClass.kt");
}
@Test
@TestMetadata("memberTypeParameterVsNestedClass2.kt")
public void testMemberTypeParameterVsNestedClass2() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/memberTypeParameterVsNestedClass2.kt");
}
@Test
@TestMetadata("memberTypeParameterVsNestedClassReference.kt")
public void testMemberTypeParameterVsNestedClassReference() throws Exception {
runTest("compiler/testData/diagnostics/tests/typeParameters/memberTypeParameterVsNestedClassReference.kt");
}
@Test
@TestMetadata("misplacedConstraints.kt")
public void testMisplacedConstraints() throws Exception {