From 3aa6edca7b5be75a99e01112a55915fb5fb2eda8 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Wed, 1 Apr 2015 20:38:49 +0300 Subject: [PATCH] Escape soft keywords as well --- .../jetbrains/kotlin/lang/resolve/android/AndroidConst.kt | 2 +- .../testData/android/converter/simple/specialTags/layout.kt | 6 ++++++ .../android/converter/simple/specialTags/layout1.kt | 3 +++ .../converter/simple/specialTags/res/layout/layout.xml | 5 +++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidConst.kt b/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidConst.kt index abb79aee113..8eb0d02a781 100644 --- a/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidConst.kt +++ b/plugins/android-compiler-plugin/src/org/jetbrains/kotlin/lang/resolve/android/AndroidConst.kt @@ -38,7 +38,7 @@ public object AndroidConst { val IGNORED_XML_WIDGET_TYPES = setOf("requestFocus", "merge", "tag", "check") - val ESCAPED_IDENTIFIERS = JetTokens.KEYWORDS.getTypes() + val ESCAPED_IDENTIFIERS = (JetTokens.KEYWORDS.getTypes() + JetTokens.SOFT_KEYWORDS.getTypes()) .map { it as? JetKeywordToken }.filterNotNull().map { it.getValue() }.toSet() } diff --git a/plugins/android-compiler-plugin/testData/android/converter/simple/specialTags/layout.kt b/plugins/android-compiler-plugin/testData/android/converter/simple/specialTags/layout.kt index d23449e3972..cacfbd7fecf 100644 --- a/plugins/android-compiler-plugin/testData/android/converter/simple/specialTags/layout.kt +++ b/plugins/android-compiler-plugin/testData/android/converter/simple/specialTags/layout.kt @@ -30,3 +30,9 @@ val android.app.Activity.`fun`: ft val android.app.Fragment.`fun`: ft get() = getView().findViewById(0) as? TextView +val android.app.Activity.`set`: ft + get() = findViewById(0) as? Button + +val android.app.Fragment.`set`: ft + get() = getView().findViewById(0) as? Button + diff --git a/plugins/android-compiler-plugin/testData/android/converter/simple/specialTags/layout1.kt b/plugins/android-compiler-plugin/testData/android/converter/simple/specialTags/layout1.kt index 4a61907e601..3dc1927524f 100644 --- a/plugins/android-compiler-plugin/testData/android/converter/simple/specialTags/layout1.kt +++ b/plugins/android-compiler-plugin/testData/android/converter/simple/specialTags/layout1.kt @@ -21,3 +21,6 @@ val android.view.View.fragmentTag: ft val android.view.View.`fun`: ft get() = findViewById(0) as? TextView +val android.view.View.`set`: ft + get() = findViewById(0) as? Button + diff --git a/plugins/android-compiler-plugin/testData/android/converter/simple/specialTags/res/layout/layout.xml b/plugins/android-compiler-plugin/testData/android/converter/simple/specialTags/res/layout/layout.xml index b5448700338..fcfbf4f171b 100644 --- a/plugins/android-compiler-plugin/testData/android/converter/simple/specialTags/res/layout/layout.xml +++ b/plugins/android-compiler-plugin/testData/android/converter/simple/specialTags/res/layout/layout.xml @@ -21,4 +21,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" /> +