Presentation: Fix NPE on star projection rendering

EA-100480 Fixed
This commit is contained in:
Alexey Sedunov
2017-06-13 18:53:03 +03:00
parent ab4eb1dd20
commit 1544467725
4 changed files with 17 additions and 2 deletions
@@ -97,9 +97,11 @@ class KotlinElementDescriptionProvider : ElementDescriptionProvider {
return buildString {
append(type.referencedName ?: "???")
val arguments = type.typeArgumentsAsTypes
val arguments = type.typeArguments
if (arguments.isNotEmpty()) {
arguments.joinTo(this, prefix = "<", postfix = ">") { it.accept(visitor, data) }
arguments.joinTo(this, prefix = "<", postfix = ">") {
it.typeReference?.accept(visitor, data) ?: it.text
}
}
}
}
@@ -0,0 +1,3 @@
class A<T, U, V>
fun <caret>foo(a: A<Int, *, String>) {}
@@ -0,0 +1,4 @@
Crumbs:
foo()
Tooltips:
function <b><code>foo(A&lt;Int, *, String&gt;)</code></b>
@@ -96,6 +96,12 @@ public class BreadcrumbsTestGenerated extends AbstractBreadcrumbsTest {
doTest(fileName);
}
@TestMetadata("StarProjection.kt")
public void testStarProjection() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/breadcrumbs/StarProjection.kt");
doTest(fileName);
}
@TestMetadata("Try.kt")
public void testTry() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/codeInsight/breadcrumbs/Try.kt");