Change Signature: Introduce variable for expression which can't be safely copied in the course of argument substitution
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// WITH_DEFAULT_VALUE: false
|
||||
class T(val t: Int)
|
||||
|
||||
fun foo(t: T): Int {
|
||||
return t.t / 2
|
||||
}
|
||||
|
||||
fun bar(x: Int = foo(T(T(2).t + 1)))
|
||||
|
||||
fun test() {
|
||||
val i = T(2).t
|
||||
foo(T(i + 1))
|
||||
}
|
||||
Reference in New Issue
Block a user