提交 a9831379 编写于 作者: Y Yan Zhulanow 提交者: Yan Zhulanow

Kapt: Handle parameter with Java names clashing with Java keywords properly (KT-18377)

上级 e56e3d78
......@@ -437,7 +437,7 @@ class ClassFileToSourceStubConverter(
info.visibleAnnotations,
info.invisibleAnnotations)
val name = treeMaker.name(getValidIdentifierName(info.name) ?: "p${index}_" + info.name.hashCode())
val name = treeMaker.name(getValidIdentifierName(info.name) ?: "p${index}_" + info.name.hashCode().ushr(1))
val type = treeMaker.Type(info.type)
treeMaker.VarDef(modifiers, name, type, null)
}
......
......@@ -180,6 +180,12 @@ public class ClassFileToSourceStubConverterTestGenerated extends AbstractClassFi
doTest(fileName);
}
@TestMetadata("kt18377.kt")
public void testKt18377() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("plugins/kapt3/testData/converter/kt18377.kt");
doTest(fileName);
}
@TestMetadata("mapEntry.kt")
public void testMapEntry() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("plugins/kapt3/testData/converter/mapEntry.kt");
......
import java.util.Date
fun Date(double: Double): Date = Date(double.times(1000).toLong())
\ No newline at end of file
@kotlin.Metadata()
public final class Kt18377Kt {
public Kt18377Kt() {
super();
}
@org.jetbrains.annotations.NotNull()
public static final java.util.Date Date(double p0_1484504552) {
return null;
}
}
......@@ -50,7 +50,7 @@ public final class Test {
public final void strangeFun4(@org.jetbrains.annotations.NotNull()
java.lang.String a, @org.jetbrains.annotations.NotNull()
java.lang.String p1_1899121793) {
java.lang.String p1_949560896) {
}
public Test() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册