Remove runtime usage from unused receiver parameter tests

This commit is contained in:
Nikolay Krasko
2018-05-22 13:57:16 +03:00
parent e7a9614fb5
commit fdc6372776
5 changed files with 16 additions and 32 deletions
@@ -1,16 +1,12 @@
// WITH_RUNTIME
class Test(val str: String) {
private fun <caret>Test.print() {
println(str)
println(this.str)
println(this@print.str)
println()
println(this)
}
fun test(test: Test) {
print()
test.print()
Test("three").print()
}
@@ -19,3 +15,5 @@ class Test(val str: String) {
fun main(args: Array<String>) {
Test("one").test(Test("two"))
}
fun println(a: Any) {}
@@ -1,16 +1,12 @@
// WITH_RUNTIME
class Test(val str: String) {
private fun <caret>print() {
println(str)
println(this.str)
println(this.str)
println()
println(this)
}
fun test(test: Test) {
print()
test.print()
Test("three").print()
}
@@ -19,3 +15,5 @@ class Test(val str: String) {
fun main(args: Array<String>) {
Test("one").test(Test("two"))
}
fun println(a: Any) {}
@@ -1,23 +1,9 @@
// PROBLEM: none
// WITH_RUNTIME
class Test(val str: String) {
private fun <caret>Test.print() {
println(str)
println(this.str)
println(this@print.str)
println(this@Test.str)
println()
}
fun test(test: Test) {
print()
test.print()
Test("three").print()
println(this@Test.str) // Unused receiver isn't reported because of explicit usage for parent `this`
}
}
fun main(args: Array<String>) {
Test("one").test(Test("two"))
}
fun println(a: Any) {}
@@ -1,7 +1,4 @@
// WITH_RUNTIME
class Test(private val foo: Int) {
val <caret>Test.baz: Int
get() = foo + this.foo + this@baz.foo
@@ -15,3 +12,7 @@ class Test(private val foo: Int) {
fun main(args: Array<String>) {
Test(1).test(Test(2))
}
fun println(a: Any) {
// kotlin.io.println(a)
}
@@ -1,7 +1,4 @@
// WITH_RUNTIME
class Test(private val foo: Int) {
val <caret>baz: Int
get() = foo + this.foo + this.foo
@@ -15,3 +12,7 @@ class Test(private val foo: Int) {
fun main(args: Array<String>) {
Test(1).test(Test(2))
}
fun println(a: Any) {
// kotlin.io.println(a)
}