JS: fix inlining in a new flat JS generator

This commit is contained in:
Alexey Andreev
2016-10-17 16:24:02 +03:00
parent e13d34e08d
commit 20396b0e5f
257 changed files with 384 additions and 4228 deletions
@@ -5,13 +5,13 @@ package foo
@native
const val ROOT = "Kotlin.modules.JS_TESTS"
@native
const val PATH_TO_F_CREATOR = "foo.B.far\$f"
const val PATH_TO_F_CREATOR = "B\$far\$lambda"
@native
const val PATH_TO_G_CREATOR = "foo.B.gar\$f"
const val PATH_TO_G_CREATOR = "B\$gar\$lambda"
@native("$ROOT.$PATH_TO_F_CREATOR")
@native("$PATH_TO_F_CREATOR")
val F_CREATOR: Any = noImpl
@native("$ROOT.$PATH_TO_G_CREATOR")
@native("$PATH_TO_G_CREATOR")
val G_CREATOR: Any = noImpl
@@ -38,7 +38,7 @@ fun box(): String {
assertEquals("B::boo", g())
val fs = F_CREATOR.toString()
val gs = G_CREATOR.toString().replaceAll("boo", "foo")
val gs = G_CREATOR.toString().replaceAll("boo", "foo").replaceAll("gar", "far")
assertEquals(gs, fs)
+2 -2
View File
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: multiplyInline_0
// CHECK_NOT_CALLED: runNoinline_0
// CHECK_CONTAINS_NO_CALLS: multiplyInline
// CHECK_NOT_CALLED: runNoinline
internal inline fun multiply(a: Int, b: Int) = a * b
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
// A copy of stdlib run function.
// Copied to not to depend on run implementation.
@@ -1,6 +1,6 @@
package foo
// CHECK_NOT_CALLED_IN_SCOPE: scope=multiply_0 function=multiply_0$f
// CHECK_NOT_CALLED_IN_SCOPE: scope=multiply function=multiply$lambda
internal class A(val a: Int)
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: squareMultipliedByTwo_0
// CHECK_CONTAINS_NO_CALLS: squareMultipliedByTwo
internal inline fun inline1(a: Int): Int {
return a
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: squareMultipliedByTwo_0
// CHECK_CONTAINS_NO_CALLS: squareMultipliedByTwo
internal inline fun inline1(a: Int): Int {
return a
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: identity_0
// CHECK_CONTAINS_NO_CALLS: sumNoInline_0
// CHECK_CONTAINS_NO_CALLS: identity
// CHECK_CONTAINS_NO_CALLS: sumNoInline
internal inline fun sum(a: Int, b: Int = 0): Int {
return a + b
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: doNothingNoInline_0
// CHECK_CONTAINS_NO_CALLS: doNothingNoInline
internal inline fun <T> doNothing1(a: T): T {
return a
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: doNothingInt_0
// CHECK_CONTAINS_NO_CALLS: doNothingStr_0
// CHECK_CONTAINS_NO_CALLS: doNothingInt
// CHECK_CONTAINS_NO_CALLS: doNothingStr
internal inline fun <T> doNothing(a: T): T {
return a
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: multiplyNoInline_0
// CHECK_CONTAINS_NO_CALLS: multiplyNoInline
internal inline fun multiply(a: Int, b: Int): Int {
return a * b
+3 -3
View File
@@ -1,8 +1,8 @@
package foo
// CHECK_CONTAINS_NO_CALLS: doNothing1_0
// CHECK_CONTAINS_NO_CALLS: doNothing2_0
// CHECK_CONTAINS_NO_CALLS: doNothing3_0
// CHECK_CONTAINS_NO_CALLS: doNothing1
// CHECK_CONTAINS_NO_CALLS: doNothing2
// CHECK_CONTAINS_NO_CALLS: doNothing3
internal class Inline {
public inline fun <T> identity1 (x: T): T {
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: sumEven_0
// CHECK_CONTAINS_NO_CALLS: sumEven
internal inline fun filteredReduce(a: Array<Int>, predicate: (Int) -> Boolean, reduceFun: (Int, Int) -> Int): Int {
var result = 0
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: maxBySquare_0
// CHECK_CONTAINS_NO_CALLS: maxBySquare
internal data class Result(var value: Int = 0, var invocationCount: Int = 0)
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: add_0
// CHECK_CONTAINS_NO_CALLS: add
internal data class IntPair(public var fst: Int, public var snd: Int) {
inline public fun getFst(): Int { return fst }
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: factAbsNoInline1_0
// CHECK_CONTAINS_NO_CALLS: factAbsNoInline1
internal class State(value: Int) {
public var value: Int = value
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
internal inline fun sum(x: Int, y: Int): Int = js("x + y")
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
internal inline fun sum(x: Int, y: Int): Int = js("var a = x; a + y")
+3 -3
View File
@@ -1,8 +1,8 @@
package foo
// CHECK_CALLED_IN_SCOPE: scope=multiplyBy2_0 function=multiplyBy2_0$f
// CHECK_NOT_CALLED_IN_SCOPE: scope=multiplyBy2_0 function=multiplyBy2_0$f_0
// CHECK_NOT_CALLED_IN_SCOPE: scope=multiplyBy2_0 function=run
// CHECK_CALLED_IN_SCOPE: scope=multiplyBy2 function=multiplyBy2$lambda
// CHECK_NOT_CALLED_IN_SCOPE: scope=multiplyBy2 function=multiplyBy2$lambda_0
// CHECK_NOT_CALLED_IN_SCOPE: scope=multiplyBy2 function=run
internal inline fun <T> runLambdaInLambda(noinline inner: (T) -> T, outer: ((T) -> T, T) -> T, arg: T): T {
return outer(inner, arg)
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: capturedInLambda_0
// CHECK_CONTAINS_NO_CALLS: declaredInLambda_0
// CHECK_CONTAINS_NO_CALLS: capturedInLambda
// CHECK_CONTAINS_NO_CALLS: declaredInLambda
internal data class State(var count: Int = 0)
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: localWithCapture_0
// CHECK_CONTAINS_NO_CALLS: localWithoutCapture_0
// CHECK_CONTAINS_NO_CALLS: localWithCapture
// CHECK_CONTAINS_NO_CALLS: localWithoutCapture
internal inline fun repeatAction(times: Int, action: () -> Unit) {
for (i in 1..times) {
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: add_0
// CHECK_CONTAINS_NO_CALLS: add
internal data class State(var count: Int = 0)
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: localWithCapture_0
// CHECK_CONTAINS_NO_CALLS: localWithoutCapture_0
// CHECK_CONTAINS_NO_CALLS: localWithCapture
// CHECK_CONTAINS_NO_CALLS: localWithoutCapture
internal inline fun repeatAction(times: Int, action: () -> Unit) {
for (i in 1..times) {
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: add_0
// CHECK_CONTAINS_NO_CALLS: add
internal inline fun run(action: () -> Int): Int {
return action()
@@ -1,11 +1,11 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test1_0
// CHECK_CONTAINS_NO_CALLS: test2_0
// CHECK_CONTAINS_NO_CALLS: test3_0
// CHECK_CONTAINS_NO_CALLS: test1
// CHECK_CONTAINS_NO_CALLS: test2
// CHECK_CONTAINS_NO_CALLS: test3
// CHECK_CONTAINS_NO_CALLS: test4_buocd8$
// CHECK_CONTAINS_NO_CALLS: test5_0
// CHECK_HAS_INLINE_METADATA: apply_hiyix$
// CHECK_CONTAINS_NO_CALLS: test5
// CHECK_HAS_INLINE_METADATA: apply
// CHECK_HAS_INLINE_METADATA: applyL_hiyix$
// CHECK_HAS_INLINE_METADATA: applyM_hiyix$
// CHECK_HAS_NO_INLINE_METADATA: applyN_hiyix$
+2 -2
View File
@@ -1,7 +1,7 @@
package foo
// CHECK_CALLED_IN_SCOPE: scope=multiplyBy2_0 function=multiplyBy2_0$f
// CHECK_NOT_CALLED_IN_SCOPE: scope=multiplyBy2_0 function=run
// CHECK_CALLED_IN_SCOPE: scope=multiplyBy2 function=multiplyBy2$lambda
// CHECK_NOT_CALLED_IN_SCOPE: scope=multiplyBy2 function=run
internal inline fun <T> run(noinline func: (T) -> T, arg: T): T {
return func(arg)
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: sum_0
// CHECK_CONTAINS_NO_CALLS: sum
inline fun <T : Any, R> T.doLet(f: (T) -> R): R = f(this)
+3 -3
View File
@@ -1,9 +1,9 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test1_0
// CHECK_CONTAINS_NO_CALLS: test2_0
// CHECK_CONTAINS_NO_CALLS: test3_0 except=slice
// CHECK_CONTAINS_NO_CALLS: test1
// CHECK_CONTAINS_NO_CALLS: test2
// CHECK_CONTAINS_NO_CALLS: test3 except=slice
internal inline fun concat(vararg strings: String): String {
var result = ""
+1 -1
View File
@@ -8,7 +8,7 @@ package foo
import test.*
// CHECK_CONTAINS_NO_CALLS: testClassObject_0
// CHECK_CONTAINS_NO_CALLS: testClassObject
internal fun testFinalInline(): String {
return Z().finalInline({"final"})
@@ -17,7 +17,7 @@ public fun log(s: String): String {
import utils.*
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
internal fun test(s: String): String = log(s + ";")
@@ -12,7 +12,7 @@ public fun <T, R> apply(x: T, fn: (T)->R): R =
import utils.*
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
internal fun multiplyBy2(x: Int): Int = x * 2
@@ -9,7 +9,7 @@ public fun sum(x: Int, y: Int): Int =
// MODULE: main(lib)
// FILE: main.kt
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
internal fun test(x: Int, y: Int): Int = utils.sum(x, y)
@@ -13,7 +13,7 @@ public fun <T, R> apply(x: T, fn: T.()->R): R =
import utils.*
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
internal class A(val n: Int)
+1 -1
View File
@@ -13,7 +13,7 @@ public fun <T, R> apply(x: T, fn: (T)->R): R =
import utils.*
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
internal fun test(x: Int): Int = apply(x) { it * 2 }
@@ -13,7 +13,7 @@ public fun <T, R> apply(x: T, fn: (T)->R): R =
import utils.*
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
internal fun test(x: Int, y: Int): Int = apply(x) { it + y }
@@ -15,7 +15,7 @@ public fun <T, R> apply(x: T, fn: (T)->R): R {
import utils.*
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
internal fun test(x: Int, y: Int): Int = apply(x) { it + 1 } * y
+1 -1
View File
@@ -14,7 +14,7 @@ public class A(public val x: Int) {
import utils.*
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
internal fun test(a: A, y: Int): Int = a.plus(y)
+1 -1
View File
@@ -13,7 +13,7 @@ public fun sum(x: Int, y: Int): Int =
import utils.*
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
internal fun test(x: Int, y: Int): Int = sum(x, y)
@@ -1,8 +1,8 @@
package foo
// CHECK_NOT_CALLED: f1_0
// CHECK_NOT_CALLED: f2_0
// CHECK_BREAKS_COUNT: function=test_0 count=3
// CHECK_NOT_CALLED: f1
// CHECK_NOT_CALLED: f2
// CHECK_BREAKS_COUNT: function=test count=3
internal var even = arrayListOf<Int>()
internal var odd = arrayListOf<Int>()
@@ -1,6 +1,6 @@
package foo
// CHECK_VARS_COUNT: function=test_za3lpa$ count=2
// CHECK_VARS_COUNT: function=test count=2
inline fun if1(f: (Int) -> Int, a: Int, b: Int, c: Int): Int {
val result = f(a)
@@ -1,9 +1,9 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test1_0
// CHECK_CONTAINS_NO_CALLS: test2_0
// CHECK_VARS_COUNT: function=test1_0 count=0
// CHECK_VARS_COUNT: function=test2_0 count=1
// CHECK_CONTAINS_NO_CALLS: test1
// CHECK_CONTAINS_NO_CALLS: test2
// CHECK_VARS_COUNT: function=test1 count=0
// CHECK_VARS_COUNT: function=test2 count=1
var log = ""
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_VARS_COUNT: function=test_0 count=0
// CHECK_CONTAINS_NO_CALLS: test except=SumHolder_getInstance
// CHECK_VARS_COUNT: function=test count=1
object SumHolder {
var sum = 0
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_VARS_COUNT: function=test_0 count=0
// CHECK_CONTAINS_NO_CALLS: test
// CHECK_VARS_COUNT: function=test count=0
internal inline fun sign(x: Int): Int {
if (x < 0) return -1
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_VARS_COUNT: function=test_0 count=0
// CHECK_CONTAINS_NO_CALLS: test
// CHECK_VARS_COUNT: function=test count=0
// A copy of stdlib run function.
// Copied to not to depend on run implementation.
@@ -1,8 +1,8 @@
package foo
// CHECK_VARS_COUNT: function=test1_za3lpa$ count=0
// CHECK_VARS_COUNT: function=test2_za3lpa$ count=1
// CHECK_VARS_COUNT: function=test3_za3lpa$ count=0
// CHECK_VARS_COUNT: function=test1 count=0
// CHECK_VARS_COUNT: function=test2 count=1
// CHECK_VARS_COUNT: function=test3 count=0
inline fun a(x: Int) = b(x)
+2 -2
View File
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_VARS_COUNT: function=test_0 count=0
// CHECK_CONTAINS_NO_CALLS: test
// CHECK_VARS_COUNT: function=test count=0
internal class A(val x: Int) {
inline fun f(): Int = x
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_VARS_COUNT: function=test_0 count=1
// CHECK_CONTAINS_NO_CALLS: test
// CHECK_VARS_COUNT: function=test count=1
internal inline fun sum(x: Int, y: Int): Int {
if (x == 0 || y == 0) return 0
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_VARS_COUNT: function=test_0 count=1
// CHECK_CONTAINS_NO_CALLS: test
// CHECK_VARS_COUNT: function=test count=1
internal inline fun sum(x: Int, y: Int): Int {
if (x == 0 || y == 0) return 0
@@ -1,7 +1,7 @@
package foo
// CHECK_NOT_CALLED_IN_SCOPE: scope=test_0 function=even_0
// CHECK_NOT_CALLED_IN_SCOPE: scope=test_0 function=filter_azvtw4$
// CHECK_NOT_CALLED_IN_SCOPE: scope=test function=even
// CHECK_NOT_CALLED_IN_SCOPE: scope=test function=filter_azvtw4$
internal fun even(x: Int) = x % 2 == 0
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
internal fun test(a: Int, b: Int): Int {
var c = 0
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
internal fun test(a: Int, b: Int): Int {
var res = 0
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
internal fun test(x: Int, y: Int): Int =
with (x + x) {
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_CONTAINS_NO_CALLS: test
internal var counter = 0
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: testImplicitThis_0
// CHECK_CONTAINS_NO_CALLS: testExplicitThis_0
// CHECK_CONTAINS_NO_CALLS: testImplicitThis
// CHECK_CONTAINS_NO_CALLS: testExplicitThis
internal class A(var value: Int)
@@ -1,9 +1,9 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_LABELS_COUNT: function=test_0 name=loop count=1
// CHECK_LABELS_COUNT: function=test_0 name=loop_0 count=1
// CHECK_LABELS_COUNT: function=test_0 name=loop_1 count=1
// CHECK_CONTAINS_NO_CALLS: test
// CHECK_LABELS_COUNT: function=test name=loop count=1
// CHECK_LABELS_COUNT: function=test name=loop_0 count=1
// CHECK_LABELS_COUNT: function=test name=loop_1 count=1
class State() {
public var value: Int = 0
@@ -1,8 +1,8 @@
package foo
// CHECK_LABELS_COUNT: function=test_0 name=loop count=1
// CHECK_LABELS_COUNT: function=test_0 name=loop_0 count=1
// CHECK_LABELS_COUNT: function=test_0 name=loop_1 count=1
// CHECK_LABELS_COUNT: function=test name=loop count=1
// CHECK_LABELS_COUNT: function=test name=loop_0 count=1
// CHECK_LABELS_COUNT: function=test name=loop_1 count=1
class State() {
public var value: Int = 0
-45
View File
@@ -1,45 +0,0 @@
NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
dataClass / param
dataClass / val
dataClass / var
delegated / fun
delegated / funParam
delegated / label
delegated / val
delegated / var
enum / entry
enum / fun
enum / funParam
enum / label
enum / val
enum / var
insideClass / fun
insideClass / funParam
insideClass / label
insideClass / val
insideClass / var
insideClassObject / fun
insideClassObject / funParam
insideClassObject / label
insideClassObject / val
insideClassObject / var
insideObject / fun
insideObject / funParam
insideObject / label
insideObject / val
insideObject / var
local / catch
local / fun
local / funParam
local / label
local / val
local / var
toplevel / class
toplevel / enum
toplevel / fun
toplevel / funParam
toplevel / interface
toplevel / label
toplevel / object
toplevel / val
toplevel / var
@@ -1,22 +0,0 @@
NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
break
class
continue
do
else
false
for
if
in
interface
null
package
return
super
this
throw
true
try
typeof
var
while
@@ -1,32 +0,0 @@
NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
Infinity
Kotlin
NaN
arguments
await
case
catch
const
debugger
default
delete
enum
eval
export
extends
finally
function
implements
import
instanceof
let
new
private
protected
public
static
switch
undefined
void
with
yield
-24
View File
@@ -1,24 +0,0 @@
package foo
import kotlin.text.Regex
fun testRenamed(case: String, f: () -> Unit) = test(case, true, f)
fun testNotRenamed(case: String, f: () -> Unit) = test(case, false, f)
fun test(keyword: String, expectedRenamed: Boolean, f: Any) {
val fs = f.toString().replace("while (false)", "")
val matches = Regex("[\\w$]*$keyword[\\w_$]*").matchAll(fs).map { it.value }.toList()
assertNotEquals(0, matches.size, "matches is empty for fs = $fs")
val actual = matches.last()
assertTrue(actual.contains(keyword), "'$keyword' not found in '$matches' from '$fs'")
if (expectedRenamed) {
assertNotEquals(keyword, actual, "fs = $fs")
}
else {
assertEquals(keyword, actual, "fs = $fs")
}
}
@@ -1,15 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
data class DataClass(val `typeof`: String) {
init {
testNotRenamed("typeof", { `typeof` })
}
}
fun box(): String {
DataClass("123")
return "OK"
}
@@ -1,15 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
data class DataClass(val `var`: String) {
init {
testNotRenamed("var", { `var` })
}
}
fun box(): String {
DataClass("123")
return "OK"
}
@@ -1,15 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
data class DataClass(val with: String) {
init {
testNotRenamed("with", { with })
}
}
fun box(): String {
DataClass("123")
return "OK"
}
@@ -1,15 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
data class DataClass(val yield: String) {
init {
testNotRenamed("yield", { yield })
}
}
fun box(): String {
DataClass("123")
return "OK"
}
@@ -1,15 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
data class DataClass(var `break`: String) {
init {
testNotRenamed("break", { `break` })
}
}
fun box(): String {
DataClass("123")
return "OK"
}
@@ -1,15 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
data class DataClass(var Infinity: String) {
init {
testNotRenamed("Infinity", { Infinity })
}
}
fun box(): String {
DataClass("123")
return "OK"
}
@@ -1,15 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
data class DataClass(var Kotlin: String) {
init {
testNotRenamed("Kotlin", { Kotlin })
}
}
fun box(): String {
DataClass("123")
return "OK"
}
@@ -1,15 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
data class DataClass(var `while`: String) {
init {
testNotRenamed("while", { `while` })
}
}
fun box(): String {
DataClass("123")
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun debugger()
}
class TraitImpl : Trait {
override fun debugger() { debugger() }
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("debugger", { debugger() })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun default()
}
class TraitImpl : Trait {
override fun default() { default() }
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("default", { default() })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun `if`()
}
class TraitImpl : Trait {
override fun `if`() { `if`() }
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("if", { `if`() })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun `in`()
}
class TraitImpl : Trait {
override fun `in`() { `in`() }
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("in", { `in`() })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,26 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun foo(delete: String)
}
class TraitImpl : Trait {
override fun foo(delete: String) {
assertEquals("123", delete)
testRenamed("delete", { delete })
}
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
foo("123")
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,26 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun foo(enum: String)
}
class TraitImpl : Trait {
override fun foo(enum: String) {
assertEquals("123", enum)
testRenamed("enum", { enum })
}
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
foo("123")
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,26 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun foo(`interface`: String)
}
class TraitImpl : Trait {
override fun foo(`interface`: String) {
assertEquals("123", `interface`)
testRenamed("interface", { `interface` })
}
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
foo("123")
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,26 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun foo(`null`: String)
}
class TraitImpl : Trait {
override fun foo(`null`: String) {
assertEquals("123", `null`)
testRenamed("null", { `null` })
}
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
foo("123")
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
val t: Int
}
class TraitImpl : Trait {
override val t: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testRenamed("eval", { eval@ while (false) {} })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
val t: Int
}
class TraitImpl : Trait {
override val t: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testRenamed("export", { export@ while (false) {} })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
val t: Int
}
class TraitImpl : Trait {
override val t: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testRenamed("package", { `package`@ while (false) {} })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
val t: Int
}
class TraitImpl : Trait {
override val t: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testRenamed("return", { `return`@ while (false) {} })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
val await: Int
}
class TraitImpl : Trait {
override val await: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("await", { await })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
val case: Int
}
class TraitImpl : Trait {
override val case: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("case", { case })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
val `do`: Int
}
class TraitImpl : Trait {
override val `do`: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("do", { `do` })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
val `else`: Int
}
class TraitImpl : Trait {
override val `else`: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("else", { `else` })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
var catch: Int
}
class TraitImpl : Trait {
override var catch: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("catch", { catch })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
var const: Int
}
class TraitImpl : Trait {
override var const: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("const", { const })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
var `false`: Int
}
class TraitImpl : Trait {
override var `false`: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("false", { `false` })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
var `for`: Int
}
class TraitImpl : Trait {
override var `for`: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("for", { `for` })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -1,13 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
`continue`
}
fun box(): String {
testNotRenamed("continue", { Foo.`continue` })
return "OK"
}
@@ -1,13 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
`do`
}
fun box(): String {
testNotRenamed("do", { Foo.`do` })
return "OK"
}
@@ -1,13 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
`public`
}
fun box(): String {
testNotRenamed("public", { Foo.`public` })
return "OK"
}
@@ -1,13 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
static
}
fun box(): String {
testNotRenamed("static", { Foo.static })
return "OK"
}
@@ -1,18 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
BAR;
fun import() { import() }
fun test() {
testNotRenamed("import", { import() })
}
}
fun box(): String {
Foo.BAR.test()
return "OK"
}
@@ -1,18 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
BAR;
fun instanceof() { instanceof() }
fun test() {
testNotRenamed("instanceof", { instanceof() })
}
}
fun box(): String {
Foo.BAR.test()
return "OK"
}
@@ -1,21 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
BAR;
fun foo(let: String) {
assertEquals("123", let)
testRenamed("let", { let })
}
fun test() {
foo("123")
}
}
fun box(): String {
Foo.BAR.test()
return "OK"
}
@@ -1,21 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
BAR;
fun foo(new: String) {
assertEquals("123", new)
testRenamed("new", { new })
}
fun test() {
foo("123")
}
}
fun box(): String {
Foo.BAR.test()
return "OK"
}
@@ -1,21 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
BAR;
fun foo(`var`: String) {
assertEquals("123", `var`)
testRenamed("var", { `var` })
}
fun test() {
foo("123")
}
}
fun box(): String {
Foo.BAR.test()
return "OK"
}
@@ -1,21 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
BAR;
fun foo(`while`: String) {
assertEquals("123", `while`)
testRenamed("while", { `while` })
}
fun test() {
foo("123")
}
}
fun box(): String {
Foo.BAR.test()
return "OK"
}
@@ -1,18 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
BAR;
fun `try`() { `try`() }
fun test() {
testNotRenamed("try", { `try`() })
}
}
fun box(): String {
Foo.BAR.test()
return "OK"
}
@@ -1,18 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
BAR;
fun `typeof`() { `typeof`() }
fun test() {
testNotRenamed("typeof", { `typeof`() })
}
}
fun box(): String {
Foo.BAR.test()
return "OK"
}
@@ -1,18 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
BAR;
val t: Int = 0
fun test() {
testRenamed("break", { `break`@ while (false) {} })
}
}
fun box(): String {
Foo.BAR.test()
return "OK"
}

Some files were not shown because too many files have changed in this diff Show More