KT-2227 Call to toString missing when interpolating string literal.
Test only. #KT-2227
This commit is contained in:
@@ -57,5 +57,7 @@ public final class StringTest extends AbstractExpressionTest {
|
|||||||
fooBoxTest();
|
fooBoxTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testKt2227_2() throws Exception {
|
||||||
|
fooBoxTest();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package foo
|
||||||
|
|
||||||
|
var i = 0
|
||||||
|
|
||||||
|
class A() {
|
||||||
|
fun toString(): String {
|
||||||
|
i++
|
||||||
|
return "bar"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): Boolean {
|
||||||
|
val a = A()
|
||||||
|
val s = "$a == $a"
|
||||||
|
return s == "bar == bar" && i == 2
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user