Replace deprecated annotations with modifiers in testData

This commit is contained in:
Denis Zharkov
2015-09-17 13:04:46 +03:00
parent 4850fd10f0
commit 9dada595b6
18 changed files with 39 additions and 35 deletions
@@ -2,7 +2,7 @@ package foo
fun add(a: Int, b: Int): Int {
val o = object {
@inline fun add(a: Int, b: Int): Int = a + b
inline fun add(a: Int, b: Int): Int = a + b
}
return o.add(a, b)
@@ -1,7 +1,7 @@
package foo
fun multiplyBy(x: Int): () -> ((Int) -> Int) {
@inline fun applyMultiplication(y: Int): Int = x * y
inline fun applyMultiplication(y: Int): Int = x * y
return { ::applyMultiplication }
}
@@ -12,7 +12,7 @@ internal inline fun repeatAction(times: Int, action: () -> Unit) {
}
internal fun capturedInLambda(state: State, a: Int, b: Int): Int {
@inline fun State.inc() {
inline fun State.inc() {
count++
}
@@ -26,7 +26,7 @@ internal fun capturedInLambda(state: State, a: Int, b: Int): Int {
internal fun declaredInLambda(state: State, a: Int, b: Int): Int {
repeatAction(a) {
@inline fun State.inc() {
inline fun State.inc() {
count++
}
@@ -12,7 +12,7 @@ internal inline fun repeatAction(times: Int, action: () -> Unit) {
internal fun localWithoutCapture(a: Int, b: Int): Int {
var sum = 0
@inline fun inc(x: Int): Int {
inline fun inc(x: Int): Int {
return x + 1
}
@@ -26,7 +26,7 @@ internal fun localWithoutCapture(a: Int, b: Int): Int {
internal fun localWithCapture(a: Int, b: Int): Int {
var sum = 0
@inline fun inc() {
inline fun inc() {
sum++
}
@@ -11,21 +11,21 @@ internal inline fun repeatAction(times: Int, action: () -> Unit) {
}
internal fun add(state: State, a: Int, b: Int): Int {
@inline fun inc(a: Int): Int {
inline fun inc(a: Int): Int {
return a + 1
}
@inline fun inc1(a: Int): Int {
inline fun inc1(a: Int): Int {
return inc(a)
}
repeatAction(a) {
@inline fun inc2(a: Int): Int {
inline fun inc2(a: Int): Int {
return inc1(a)
}
repeatAction(b) {
@inline fun State.inc() {
inline fun State.inc() {
count = inc2(count)
}
@@ -13,7 +13,7 @@ internal fun localWithoutCapture(a: Int, b: Int): Int {
var mult = 0
repeatAction(a) {
@inline fun inc(x: Int): Int {
inline fun inc(x: Int): Int {
return x + 1
}
@@ -29,7 +29,7 @@ internal fun localWithCapture(a: Int, b: Int): Int {
var mult = 0
repeatAction(a) {
@inline fun inc() {
inline fun inc() {
mult++
}
@@ -9,7 +9,7 @@ internal inline fun run(action: () -> Int): Int {
internal fun add(a: Int, b: Int): Int {
var sum = a + b
@inline fun getSum(): Int {
inline fun getSum(): Int {
return sum
}
@@ -1,7 +1,7 @@
package foo
fun multiplyBy(a: Int): (Int) -> Int {
@inline fun multiply(b: Int): Int = a * b
inline fun multiply(b: Int): Int = a * b
return ::multiply
}
+1 -1
View File
@@ -9,7 +9,7 @@ enum class MyEnum {
K;
//TODO: KT-4693
@inline fun <T> doSmth(a: T) : String {
inline fun <T> doSmth(a: T) : String {
return a.toString() + K.name()
}
}
@@ -9,9 +9,9 @@ class State() {
}
internal fun test(state: State) {
@inline fun test3() {
@inline fun test2() {
@inline fun test1() {
inline fun test3() {
inline fun test2() {
inline fun test1() {
loop@ for (i in 1..10) {
state.value++
if (i == 2) break@loop