Files
kotlin-fork/compiler/visualizer/testData/rawBuilder/expressions/modifications.kt
T
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00

46 lines
1.0 KiB
Kotlin
Vendored

// WITH_STDLIB
fun simple() {
// Int Int
// │ │
var x = 10
// var simple.x: Int
// │ fun (Int).plus(Int): Int
// │ │ Int
// │ │ │
x += 20
// var simple.x: Int
// │ fun (Int).minus(Int): Int
// │ │ Int
// │ │ │
x -= 5
// var simple.x: Int
// │ fun (Int).div(Int): Int
// │ │ Int
// │ │ │
x /= 5
// var simple.x: Int
// │ fun (Int).times(Int): Int
// │ │ Int
// │ │ │
x *= 10
}
// collections/List<String>
// │
fun List<String>.modify() {
// fun <T> collections/Collection<T>.plus<String>(T): collections/List<T>
// │
this += "Alpha"
// fun <T> collections/Collection<T>.plus<String>(T): collections/List<T>
// │
this += "Omega"
}
fun Any.modify() {
// collections/List<Int>
// │ fun <T> collections/Collection<T>.plus<Int>(T): collections/List<T>
// │ │ Int
// │ │ │
(this as List<Int>) += 42
}