[FIR] Consider extension receiver type in conflicting members checker

This commit is contained in:
Dmitriy Novozhilov
2021-08-05 14:24:08 +03:00
committed by TeamCityServer
parent cd09c8ba51
commit a9882a86c0
7 changed files with 61 additions and 1 deletions
@@ -2701,6 +2701,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/overrides/protobufExt.kt");
}
@TestMetadata("sameValueParametersDifferentReceiver.kt")
public void testSameValueParametersDifferentReceiver() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/overrides/sameValueParametersDifferentReceiver.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/overrides/simple.kt");
@@ -0,0 +1,21 @@
FILE: sameValueParametersDifferentReceiver.kt
public open class A : R|kotlin/Any| {
public constructor(): R|A| {
super<R|kotlin/Any|>()
}
public final fun R|kotlin/String|.foo(from: R|kotlin/String|, to: R|kotlin/String|): R|kotlin/Int| {
^foo Int(1)
}
public final fun <T> R|T|.foo(from: R|kotlin/String|, to: R|kotlin/String|): R|kotlin/Int| {
^foo Int(1)
}
}
public final class B : R|A| {
public constructor(): R|B| {
super<R|A|>()
}
}
@@ -0,0 +1,11 @@
open class A {
fun String.foo(from: String, to: String): Int {
return 1
}
fun <T> T.foo(from: String, to: String): Int {
return 1
}
}
class B : A()
@@ -3059,6 +3059,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
runTest("compiler/fir/analysis-tests/testData/resolve/overrides/protobufExt.kt");
}
@Test
@TestMetadata("sameValueParametersDifferentReceiver.kt")
public void testSameValueParametersDifferentReceiver() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/overrides/sameValueParametersDifferentReceiver.kt");
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
@@ -3059,6 +3059,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
runTest("compiler/fir/analysis-tests/testData/resolve/overrides/protobufExt.kt");
}
@Test
@TestMetadata("sameValueParametersDifferentReceiver.kt")
public void testSameValueParametersDifferentReceiver() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/overrides/sameValueParametersDifferentReceiver.kt");
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {