[FIR] Complete WRONG_SETTER_TYPE_PARAMETER checker

This commit is contained in:
yantimirov-timur
2021-03-03 17:46:26 +03:00
committed by Mikhail Glukhikh
parent 5472199bb1
commit 9e7f6332d1
18 changed files with 151 additions and 11 deletions
@@ -359,6 +359,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/sealedClass.kt");
}
@TestMetadata("settersGetters.kt")
public void testSettersGetters() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/settersGetters.kt");
}
@TestMetadata("simpleClass.kt")
public void testSimpleClass() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/simpleClass.kt");
@@ -0,0 +1,13 @@
FILE: settersGetters.kt
public final class SomeClass : R|kotlin/Any| {
public constructor(): R|SomeClass| {
super<R|kotlin/Any|>()
}
public final var foo: R|kotlin/Int| = Int(0)
public get(): R|kotlin/Int|
public set(value: R|kotlin/String|): R|kotlin/Unit| {
this@R|/SomeClass|.F|/SomeClass.foo| = R|<local>/value|
}
}
@@ -0,0 +1,8 @@
class SomeClass {
var foo: Int = 0
set(value: <!WRONG_SETTER_PARAMETER_TYPE!>String<!>){
field = value
}
}
@@ -422,6 +422,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
runTest("compiler/fir/analysis-tests/testData/resolve/sealedClass.kt");
}
@Test
@TestMetadata("settersGetters.kt")
public void testSettersGetters() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/settersGetters.kt");
}
@Test
@TestMetadata("simpleClass.kt")
public void testSimpleClass() throws Exception {
@@ -425,6 +425,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
runTest("compiler/fir/analysis-tests/testData/resolve/sealedClass.kt");
}
@Test
@TestMetadata("settersGetters.kt")
public void testSettersGetters() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/settersGetters.kt");
}
@Test
@TestMetadata("simpleClass.kt")
public void testSimpleClass() throws Exception {