'yield' reserved as a keyword

This commit is contained in:
Andrey Breslav
2015-12-08 18:31:20 +03:00
parent e6bba01798
commit 434082cadb
123 changed files with 1138 additions and 1073 deletions
@@ -1,4 +1,4 @@
/* The following code was generated by JFlex 1.4.3 on 11/27/15 4:27 PM */
/* The following code was generated by JFlex 1.4.3 on 11/30/15 6:43 PM */
package org.jetbrains.kotlin.kdoc.lexer;
@@ -13,7 +13,7 @@ import org.jetbrains.kotlin.kdoc.parser.KDocKnownTag;
/**
* This class is a scanner generated by
* <a href="http://www.jflex.de/">JFlex</a> 1.4.3
* on 11/27/15 4:27 PM from the specification file
* on 11/30/15 6:43 PM from the specification file
* <tt>/Users/abreslav/work/kotlin/compiler/frontend/src/org/jetbrains/kotlin/kdoc/lexer/KDoc.flex</tt>
*/
class _KDocLexer implements FlexLexer {
@@ -246,6 +246,7 @@ LONG_TEMPLATE_ENTRY_START=\$\{
"throw" { return KtTokens.THROW_KEYWORD ;}
"false" { return KtTokens.FALSE_KEYWORD ;}
"super" { return KtTokens.SUPER_KEYWORD ;}
"yield" { return KtTokens.YIELD_KEYWORD ;}
"when" { return KtTokens.WHEN_KEYWORD ;}
"true" { return KtTokens.TRUE_KEYWORD ;}
"this" { return KtTokens.THIS_KEYWORD ;}
@@ -77,6 +77,9 @@ public interface KtTokens {
KtKeywordToken WHEN_KEYWORD = KtKeywordToken.keyword("when");
KtKeywordToken INTERFACE_KEYWORD = KtKeywordToken.keyword("interface");
// Reserved for future use:
KtKeywordToken YIELD_KEYWORD = KtKeywordToken.keyword("yield");
KtToken AS_SAFE = KtKeywordToken.keyword("AS_SAFE");//new KtToken("as?");
KtToken IDENTIFIER = new KtToken("IDENTIFIER");
@@ -188,7 +191,8 @@ public interface KtTokens {
TRUE_KEYWORD, FALSE_KEYWORD, IS_KEYWORD,
IN_KEYWORD, THROW_KEYWORD, RETURN_KEYWORD, BREAK_KEYWORD, CONTINUE_KEYWORD, OBJECT_KEYWORD, IF_KEYWORD,
ELSE_KEYWORD, WHILE_KEYWORD, DO_KEYWORD, TRY_KEYWORD, WHEN_KEYWORD,
NOT_IN, NOT_IS, AS_SAFE
NOT_IN, NOT_IS, AS_SAFE,
YIELD_KEYWORD
);
TokenSet SOFT_KEYWORDS = TokenSet.create(FILE_KEYWORD, IMPORT_KEYWORD, WHERE_KEYWORD, BY_KEYWORD, GET_KEYWORD,
File diff suppressed because it is too large Load Diff
+5
View File
@@ -0,0 +1,5 @@
fun yield() {}
fun test() {
yield
}
+33
View File
@@ -0,0 +1,33 @@
JetFile: Reserved.kt
PACKAGE_DIRECTIVE
<empty list>
IMPORT_LIST
<empty list>
FUN
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiErrorElement:Expecting function name or receiver type
PsiElement(yield)('yield')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n')
FUN
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('test')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
BLOCK
PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ')
PsiErrorElement:Expecting an element
PsiElement(yield)('yield')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')
@@ -637,6 +637,12 @@ public class ParsingTestGenerated extends AbstractParsingTest {
doParsingTest(fileName);
}
@TestMetadata("Reserved.kt")
public void testReserved() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/psi/Reserved.kt");
doParsingTest(fileName);
}
@TestMetadata("RootPackage.kt")
public void testRootPackage() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/psi/RootPackage.kt");
@@ -51,6 +51,7 @@ public class KeywordStringsGenerated {
"while",
"do",
"when",
"interface"
"interface",
"yield"
));
}
@@ -320,7 +320,8 @@ class TestDataBuilder() {
error("The file '$fileName' unexpectedly exists when create test data from scratch.")
}
} else if (!isCreatingFromScratch) {
error("Unexpected new testdata file: '$fileName'. It may cause for example because of bug in stdlib.")
error("Unexpected new testdata file: '$fileName'. It may cause for example because of bug in stdlib.\n" +
"If a new keyword has been added, delete SHOULD_BE_ESCAPED.txt and SHOULD_NOT_BE_ESCAPED.txt")
}
GeneratorsFileUtil.writeFileIfContentChanged(testDataFile, out, false)
+1 -1
View File
@@ -1,2 +1,2 @@
//statement
int as, type, val, var, fun, is, in, object, when;
int as, type, val, var, fun, is, in, object, when, yield;
+2 -1
View File
@@ -6,4 +6,5 @@ val `fun`: Int
val `is`: Int
val `in`: Int
val `object`: Int
val `when`: Int
val `when`: Int
val `yield`: Int
@@ -1,6 +1,6 @@
//file
package test;
import as.type.val.var.fun.is.in.object.when;
import as.type.val.var.fun.is.in.object.when.yield;
class Test {}
@@ -1,6 +1,6 @@
// ERROR: Unresolved reference: `as`
package test
import `as`.type.`val`.`var`.`fun`.`is`.`in`.`object`.`when`
import `as`.type.`val`.`var`.`fun`.`is`.`in`.`object`.`when`.`yield`
internal class Test
File diff suppressed because it is too large Load Diff
@@ -18,4 +18,5 @@ throw
true
try
var
while
while
yield
@@ -29,5 +29,4 @@ switch
typeof
undefined
void
with
yield
with
@@ -1,15 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
data class DataClass(val undefined: String) {
init {
testNotRenamed("undefined", { undefined })
}
}
fun box(): String {
DataClass("123")
return "OK"
}
@@ -2,17 +2,14 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
BAR;
var `var`: Int = 0
fun test() {
data class DataClass(val `var`: String) {
init {
testNotRenamed("var", { `var` })
}
}
fun box(): String {
Foo.BAR.test()
DataClass("123")
return "OK"
}
@@ -2,17 +2,14 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
BAR;
var `while`: Int = 0
fun test() {
data class DataClass(val `while`: String) {
init {
testNotRenamed("while", { `while` })
}
}
fun box(): String {
Foo.BAR.test()
DataClass("123")
return "OK"
}
@@ -2,7 +2,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
data class DataClass(var with: String) {
data class DataClass(val with: String) {
init {
testNotRenamed("with", { with })
}
@@ -2,7 +2,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
data class DataClass(val `break`: String) {
data class DataClass(var `break`: String) {
init {
testNotRenamed("break", { `break` })
}
@@ -1,15 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
data class DataClass(var `continue`: String) {
init {
testNotRenamed("continue", { `continue` })
}
}
fun box(): String {
DataClass("123")
return "OK"
}
@@ -2,9 +2,9 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
data class DataClass(val `class`: String) {
data class DataClass(var Infinity: String) {
init {
testNotRenamed("class", { `class` })
testNotRenamed("Infinity", { Infinity })
}
}
@@ -2,9 +2,9 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
data class DataClass(var `do`: String) {
data class DataClass(var Kotlin: String) {
init {
testNotRenamed("do", { `do` })
testNotRenamed("Kotlin", { Kotlin })
}
}
@@ -2,9 +2,9 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
data class DataClass(var yield: String) {
data class DataClass(var `yield`: String) {
init {
testNotRenamed("yield", { yield })
testNotRenamed("yield", { `yield` })
}
}
@@ -3,16 +3,16 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun `null`()
fun debugger()
}
class TraitImpl : Trait {
override fun `null`() { `null`() }
override fun debugger() { debugger() }
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("null", { `null`() })
testNotRenamed("debugger", { debugger() })
}
}
@@ -3,16 +3,16 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun const()
fun default()
}
class TraitImpl : Trait {
override fun const() { const() }
override fun default() { default() }
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("const", { const() })
testNotRenamed("default", { default() })
}
}
@@ -3,16 +3,16 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
val NaN: Int
fun `if`()
}
class TraitImpl : Trait {
override val NaN: Int = 0
override fun `if`() { `if`() }
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("NaN", { NaN })
testNotRenamed("if", { `if`() })
}
}
@@ -3,16 +3,16 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
var `in`: Int
fun `in`()
}
class TraitImpl : Trait {
override var `in`: Int = 0
override fun `in`() { `in`() }
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("in", { `in` })
testNotRenamed("in", { `in`() })
}
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun `package`()
}
class TraitImpl : Trait {
override fun `package`() { `package`() }
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("package", { `package`() })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -3,13 +3,13 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun foo(`super`: String)
fun foo(delete: String)
}
class TraitImpl : Trait {
override fun foo(`super`: String) {
assertEquals("123", `super`)
testRenamed("super", { `super` })
override fun foo(delete: String) {
assertEquals("123", delete)
testRenamed("delete", { delete })
}
}
@@ -3,13 +3,13 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun foo(default: String)
fun foo(enum: String)
}
class TraitImpl : Trait {
override fun foo(default: String) {
assertEquals("123", default)
testRenamed("default", { default })
override fun foo(enum: String) {
assertEquals("123", enum)
testRenamed("enum", { enum })
}
}
@@ -3,13 +3,13 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun foo(debugger: String)
fun foo(`interface`: String)
}
class TraitImpl : Trait {
override fun foo(debugger: String) {
assertEquals("123", debugger)
testRenamed("debugger", { debugger })
override fun foo(`interface`: String) {
assertEquals("123", `interface`)
testRenamed("interface", { `interface` })
}
}
@@ -3,13 +3,13 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun foo(`return`: String)
fun foo(`null`: String)
}
class TraitImpl : Trait {
override fun foo(`return`: String) {
assertEquals("123", `return`)
testRenamed("return", { `return` })
override fun foo(`null`: String) {
assertEquals("123", `null`)
testRenamed("null", { `null` })
}
}
@@ -12,7 +12,7 @@ class TraitImpl : Trait {
class TestDelegate : Trait by TraitImpl() {
fun test() {
testRenamed("enum", { enum@ while (false) {} })
testRenamed("eval", { eval@ while (false) {} })
}
}
@@ -12,7 +12,7 @@ class TraitImpl : Trait {
class TestDelegate : Trait by TraitImpl() {
fun test() {
testRenamed("this", { `this`@ while (false) {} })
testRenamed("export", { export@ while (false) {} })
}
}
@@ -12,7 +12,7 @@ class TraitImpl : Trait {
class TestDelegate : Trait by TraitImpl() {
fun test() {
testRenamed("delete", { delete@ while (false) {} })
testRenamed("package", { `package`@ while (false) {} })
}
}
@@ -12,7 +12,7 @@ class TraitImpl : Trait {
class TestDelegate : Trait by TraitImpl() {
fun test() {
testRenamed("throw", { `throw`@ while (false) {} })
testRenamed("return", { `return`@ while (false) {} })
}
}
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
val arguments: Int
}
class TraitImpl : Trait {
override val arguments: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("arguments", { arguments })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -3,11 +3,11 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
var await: Int
val await: Int
}
class TraitImpl : Trait {
override var await: Int = 0
override val await: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
@@ -3,11 +3,11 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
var case: Int
val case: Int
}
class TraitImpl : Trait {
override var case: Int = 0
override val case: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
@@ -3,16 +3,16 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
val `if`: Int
val `do`: Int
}
class TraitImpl : Trait {
override val `if`: Int = 0
override val `do`: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("if", { `if` })
testNotRenamed("do", { `do` })
}
}
@@ -0,0 +1,23 @@
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"
}
@@ -0,0 +1,23 @@
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"
}
@@ -0,0 +1,23 @@
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"
}
@@ -3,16 +3,16 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
fun catch()
var `false`: Int
}
class TraitImpl : Trait {
override fun catch() { catch() }
override var `false`: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("catch", { catch() })
testNotRenamed("false", { `false` })
}
}
@@ -3,11 +3,11 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
val `for`: Int
var `for`: Int
}
class TraitImpl : Trait {
override val `for`: Int = 0
override var `for`: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
@@ -1,23 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
interface Trait {
var `interface`: Int
}
class TraitImpl : Trait {
override var `interface`: Int = 0
}
class TestDelegate : Trait by TraitImpl() {
fun test() {
testNotRenamed("interface", { `interface` })
}
}
fun box(): String {
TestDelegate().test()
return "OK"
}
@@ -3,11 +3,11 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
`protected`
`continue`
}
fun box(): String {
testNotRenamed("protected", { Foo.`protected` })
testNotRenamed("continue", { Foo.`continue` })
return "OK"
}
@@ -3,11 +3,11 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
`if`
`do`
}
fun box(): String {
testNotRenamed("if", { Foo.`if` })
testNotRenamed("do", { Foo.`do` })
return "OK"
}
@@ -3,11 +3,11 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
`private`
`public`
}
fun box(): String {
testNotRenamed("private", { Foo.`private` })
testNotRenamed("public", { Foo.`public` })
return "OK"
}
@@ -3,11 +3,11 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
`for`
static
}
fun box(): String {
testNotRenamed("for", { Foo.`for` })
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 function() { function() }
fun test() {
testNotRenamed("function", { function() })
}
}
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 implements() { implements() }
fun test() {
testNotRenamed("implements", { implements() })
}
}
fun box(): String {
Foo.BAR.test()
return "OK"
}
@@ -0,0 +1,18 @@
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"
}
@@ -4,10 +4,10 @@ package foo
enum class Foo {
BAR;
fun `class`() { `class`() }
fun instanceof() { instanceof() }
fun test() {
testNotRenamed("class", { `class`() })
testNotRenamed("instanceof", { instanceof() })
}
}
@@ -4,9 +4,9 @@ package foo
enum class Foo {
BAR;
fun foo(`do`: String) {
assertEquals("123", `do`)
testRenamed("do", { `do` })
fun foo(let: String) {
assertEquals("123", let)
testRenamed("let", { let })
}
fun test() {
@@ -4,9 +4,9 @@ package foo
enum class Foo {
BAR;
fun foo(import: String) {
assertEquals("123", import)
testRenamed("import", { import })
fun foo(new: String) {
assertEquals("123", new)
testRenamed("new", { new })
}
fun test() {
@@ -4,9 +4,9 @@ package foo
enum class Foo {
BAR;
fun foo(`continue`: String) {
assertEquals("123", `continue`)
testRenamed("continue", { `continue` })
fun foo(`while`: String) {
assertEquals("123", `while`)
testRenamed("while", { `while` })
}
fun test() {
@@ -4,9 +4,9 @@ package foo
enum class Foo {
BAR;
fun foo(instanceof: String) {
assertEquals("123", instanceof)
testRenamed("instanceof", { instanceof })
fun foo(`yield`: String) {
assertEquals("123", `yield`)
testRenamed("yield", { `yield` })
}
fun test() {
@@ -0,0 +1,18 @@
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"
}
@@ -0,0 +1,18 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
BAR;
fun `var`() { `var`() }
fun test() {
testNotRenamed("var", { `var`() })
}
}
fun box(): String {
Foo.BAR.test()
return "OK"
}
@@ -7,7 +7,7 @@ enum class Foo {
val t: Int = 0
fun test() {
testRenamed("let", { let@ while (false) {} })
testRenamed("break", { `break`@ while (false) {} })
}
}
@@ -7,7 +7,7 @@ enum class Foo {
val t: Int = 0
fun test() {
testRenamed("new", { new@ while (false) {} })
testRenamed("class", { `class`@ while (false) {} })
}
}
@@ -7,7 +7,7 @@ enum class Foo {
val t: Int = 0
fun test() {
testRenamed("false", { `false`@ while (false) {} })
testRenamed("private", { private@ while (false) {} })
}
}
@@ -7,7 +7,7 @@ enum class Foo {
val t: Int = 0
fun test() {
testRenamed("else", { `else`@ while (false) {} })
testRenamed("protected", { protected@ while (false) {} })
}
}
@@ -4,7 +4,7 @@ package foo
enum class Foo {
BAR;
var extends: Int = 0
val extends: Int = 0
fun test() {
testNotRenamed("extends", { extends })
@@ -4,7 +4,7 @@ package foo
enum class Foo {
BAR;
var finally: Int = 0
val finally: Int = 0
fun test() {
testNotRenamed("finally", { finally })
@@ -4,10 +4,10 @@ package foo
enum class Foo {
BAR;
val eval: Int = 0
val `super`: Int = 0
fun test() {
testNotRenamed("eval", { eval })
testNotRenamed("super", { `super` })
}
}
@@ -4,10 +4,10 @@ package foo
enum class Foo {
BAR;
val `try`: Int = 0
val `this`: Int = 0
fun test() {
testNotRenamed("try", { `try` })
testNotRenamed("this", { `this` })
}
}
@@ -0,0 +1,18 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
enum class Foo {
BAR;
var function: Int = 0
fun test() {
testNotRenamed("function", { function })
}
}
fun box(): String {
Foo.BAR.test()
return "OK"
}
@@ -4,10 +4,10 @@ package foo
enum class Foo {
BAR;
fun `break`() { `break`() }
var implements: Int = 0
fun test() {
testNotRenamed("break", { `break`() })
testNotRenamed("implements", { implements })
}
}
@@ -4,10 +4,10 @@ package foo
enum class Foo {
BAR;
val export: Int = 0
var `throw`: Int = 0
fun test() {
testNotRenamed("export", { export })
testNotRenamed("throw", { `throw` })
}
}
@@ -4,7 +4,7 @@ package foo
enum class Foo {
BAR;
val `true`: Int = 0
var `true`: Int = 0
fun test() {
testNotRenamed("true", { `true` })
@@ -3,10 +3,10 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
var `super`: Int = 0
fun await() { await() }
fun test() {
testNotRenamed("super", { `super` })
testNotRenamed("await", { await() })
}
}
@@ -3,9 +3,9 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
fun foo(await: String) {
assertEquals("123", await)
testRenamed("await", { await })
fun foo(catch: String) {
assertEquals("123", catch)
testRenamed("catch", { catch })
}
fun test() {
@@ -3,9 +3,9 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
fun foo(`try`: String) {
assertEquals("123", `try`)
testRenamed("try", { `try` })
fun foo(`throw`: String) {
assertEquals("123", `throw`)
testRenamed("throw", { `throw` })
}
fun test() {
@@ -3,10 +3,10 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
fun `throw`() { `throw`() }
fun `super`() { `super`() }
fun test() {
testNotRenamed("throw", { `throw`() })
testNotRenamed("super", { `super`() })
}
}
@@ -6,7 +6,7 @@ class TestClass {
val t: Int = 0
fun test() {
testRenamed("while", { `while`@ while (false) {} })
testRenamed("debugger", { debugger@ while (false) {} })
}
}
@@ -6,7 +6,7 @@ class TestClass {
val t: Int = 0
fun test() {
testRenamed("catch", { catch@ while (false) {} })
testRenamed("try", { `try`@ while (false) {} })
}
}
@@ -4,10 +4,10 @@ package foo
class TestClass {
companion object {
fun `false`() { `false`() }
fun `continue`() { `continue`() }
fun test() {
testNotRenamed("false", { `false`() })
testNotRenamed("continue", { `continue`() })
}
}
}
@@ -4,10 +4,10 @@ package foo
class TestClass {
companion object {
fun eval() { eval() }
fun `do`() { `do`() }
fun test() {
testNotRenamed("eval", { eval() })
testNotRenamed("do", { `do`() })
}
}
}
@@ -4,10 +4,10 @@ package foo
class TestClass {
companion object {
fun `else`() { `else`() }
fun extends() { extends() }
fun test() {
testNotRenamed("else", { `else`() })
testNotRenamed("extends", { extends() })
}
}
}
@@ -4,9 +4,9 @@ package foo
class TestClass {
companion object {
fun foo(`for`: String) {
assertEquals("123", `for`)
testRenamed("for", { `for` })
fun foo(`else`: String) {
assertEquals("123", `else`)
testRenamed("else", { `else` })
}
fun test() {
@@ -4,9 +4,9 @@ package foo
class TestClass {
companion object {
fun foo(`if`: String) {
assertEquals("123", `if`)
testRenamed("if", { `if` })
fun foo(`false`: String) {
assertEquals("123", `false`)
testRenamed("false", { `false` })
}
fun test() {
@@ -4,9 +4,9 @@ package foo
class TestClass {
companion object {
fun foo(extends: String) {
assertEquals("123", extends)
testRenamed("extends", { extends })
fun foo(function: String) {
assertEquals("123", function)
testRenamed("function", { function })
}
fun test() {
@@ -7,7 +7,7 @@ class TestClass {
val t: Int = 0
fun test() {
testRenamed("function", { function@ while (false) {} })
testRenamed("for", { `for`@ while (false) {} })
}
}
}
@@ -7,7 +7,7 @@ class TestClass {
val t: Int = 0
fun test() {
testRenamed("in", { `in`@ while (false) {} })
testRenamed("if", { `if`@ while (false) {} })
}
}
}
@@ -7,7 +7,7 @@ class TestClass {
val t: Int = 0
fun test() {
testRenamed("interface", { `interface`@ while (false) {} })
testRenamed("import", { import@ while (false) {} })
}
}
}
@@ -1,19 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
companion object {
val debugger: Int = 0
fun test() {
testNotRenamed("debugger", { debugger })
}
}
}
fun box(): String {
TestClass.test()
return "OK"
}
@@ -4,7 +4,7 @@ package foo
class TestClass {
companion object {
var delete: Int = 0
val delete: Int = 0
fun test() {
testNotRenamed("delete", { delete })
@@ -0,0 +1,19 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
companion object {
val `while`: Int = 0
fun test() {
testNotRenamed("while", { `while` })
}
}
}
fun box(): String {
TestClass.test()
return "OK"
}
@@ -0,0 +1,19 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
companion object {
val `yield`: Int = 0
fun test() {
testNotRenamed("yield", { `yield` })
}
}
}
fun box(): String {
TestClass.test()
return "OK"
}
@@ -4,7 +4,7 @@ package foo
class TestClass {
companion object {
val `break`: Int = 0
var `break`: Int = 0
fun test() {
testNotRenamed("break", { `break` })
@@ -4,7 +4,7 @@ package foo
class TestClass {
companion object {
val `class`: Int = 0
var `class`: Int = 0
fun test() {
testNotRenamed("class", { `class` })
@@ -1,19 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
companion object {
var `continue`: Int = 0
fun test() {
testNotRenamed("continue", { `continue` })
}
}
}
fun box(): String {
TestClass.test()
return "OK"
}
@@ -4,10 +4,10 @@ package foo
class TestClass {
companion object {
var `do`: Int = 0
var eval: Int = 0
fun test() {
testNotRenamed("do", { `do` })
testNotRenamed("eval", { eval })
}
}
}
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
var Infinity: Int = 0
val Infinity: Int = 0
fun test() {
testNotRenamed("Infinity", { Infinity })
@@ -0,0 +1,17 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
val `interface`: Int = 0
fun test() {
testNotRenamed("interface", { `interface` })
}
}
fun box(): String {
TestClass().test()
return "OK"
}
@@ -1,17 +0,0 @@
package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
val yield: Int = 0
fun test() {
testNotRenamed("yield", { yield })
}
}
fun box(): String {
TestClass().test()
return "OK"
}

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