Add tests for cases when add and remove custom accessors for val with smartcasted usage
This commit is contained in:
@@ -551,6 +551,18 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("valAddCustomAccessor")
|
||||
public void testValAddCustomAccessor() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/valAddCustomAccessor/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("valRemoveCustomAccessor")
|
||||
public void testValRemoveCustomAccessor() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/valRemoveCustomAccessor/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("jps-plugin/testData/incremental/withJava")
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package test
|
||||
|
||||
class A() {
|
||||
val x: Int? = 100
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package test
|
||||
|
||||
class A() {
|
||||
val x: Int? = 100
|
||||
get() = field?.inc()
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
Cleaning output files:
|
||||
out/production/module/test/A.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/A.kt
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/test/TestPackage.class
|
||||
out/production/module/test/UsageKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/usage.kt
|
||||
End of files
|
||||
COMPILATION FAILED
|
||||
Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type kotlin.Int?
|
||||
@@ -0,0 +1,8 @@
|
||||
package test
|
||||
|
||||
public fun usage() {
|
||||
val a = A()
|
||||
if (a.x != null) {
|
||||
a.x.dec()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package test
|
||||
|
||||
class A() {
|
||||
val x: Int? = 100
|
||||
get() = field?.inc()
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package test
|
||||
|
||||
class A() {
|
||||
val x: Int? = 100
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/test/TestPackage.class
|
||||
out/production/module/test/UsageKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/usage.kt
|
||||
End of files
|
||||
COMPILATION FAILED
|
||||
Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type kotlin.Int?
|
||||
|
||||
|
||||
Cleaning output files:
|
||||
out/production/module/test/A.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/A.kt
|
||||
src/usage.kt
|
||||
End of files
|
||||
@@ -0,0 +1,8 @@
|
||||
package test
|
||||
|
||||
public fun usage() {
|
||||
val a = A()
|
||||
if (a.x != null) {
|
||||
// a.x.dec()
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package test
|
||||
|
||||
public fun usage() {
|
||||
val a = A()
|
||||
if (a.x != null) {
|
||||
a.x.dec()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user