[KAPT] Support type annotations in K2 KAPT. Fixes KT-64479
This commit is contained in:
committed by
Space Team
parent
7e9d6e601d
commit
0dd3abba2a
@@ -392,7 +392,7 @@ private class StubGenerator(
|
||||
print(method.name, "(")
|
||||
method.parameterList.parameters.forEachIndexed{ index, parameter ->
|
||||
if (index > 0) print(", ")
|
||||
printTypeSignature(parameter.type)
|
||||
printTypeSignature(parameter.type, false)
|
||||
}
|
||||
print(")")
|
||||
}
|
||||
@@ -430,14 +430,11 @@ private class StubGenerator(
|
||||
|
||||
private fun Printer.printType(type: PsiType) {
|
||||
recordErrorTypes(type)
|
||||
type.annotations.forEach {
|
||||
printAnnotation(it, false)
|
||||
}
|
||||
printTypeSignature(type)
|
||||
printTypeSignature(type, true)
|
||||
}
|
||||
|
||||
private fun Printer.printTypeSignature(type: PsiType) {
|
||||
printWithNoIndent((if (type is PsiClassType && isErroneous(type)) type.rawType() else type).canonicalText.replace('$', '.'))
|
||||
private fun Printer.printTypeSignature(type: PsiType, annotated: Boolean) {
|
||||
printWithNoIndent((if (type is PsiClassType && isErroneous(type)) type.rawType() else type).getCanonicalText(annotated).replace('$', '.'))
|
||||
}
|
||||
|
||||
private fun Printer.printTypeParams(typeParameters: Array<PsiTypeParameter>) {
|
||||
|
||||
+6
@@ -715,6 +715,12 @@ public class KotlinKapt4ContextTestGenerated extends AbstractKotlinKapt4ContextT
|
||||
runTest("plugins/kapt4/../kapt3/kapt3-compiler/testData/converter/topLevel.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeAnnotations.kt")
|
||||
public void testTypeAnnotations() throws Exception {
|
||||
runTest("plugins/kapt4/../kapt3/kapt3-compiler/testData/converter/typeAnnotations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unresolvedDelegateExpression.kt")
|
||||
public void testUnresolvedDelegateExpression() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user