KT-21928 Structure view doesn't show default constructor

This commit is contained in:
Toshiaki Kameyama
2017-12-22 11:19:59 +09:00
committed by Nikolay Krasko
parent 3178dee759
commit 9fad40b586
5 changed files with 12 additions and 2 deletions
@@ -126,5 +126,8 @@ private class AssignableLazyProperty<in R, T : Any>(val init: () -> T) : ReadWri
}
}
fun KtClassOrObject.getStructureDeclarations() = primaryConstructorParameters.filter { it.hasValOrVar() } + declarations
fun KtClassOrObject.getStructureDeclarations() =
(primaryConstructor?.let { listOf(it) } ?: emptyList()) +
primaryConstructorParameters.filter { it.hasValOrVar() } +
declarations
@@ -1,6 +1,7 @@
-InheritedJavaMembers.kt
-InheritedJavaMembers
call(): String! location=→Callable
constructor InheritedJavaMembers()
equals(Any?): Boolean location=→Any
hashCode(): Int location=→Any
test(): Unit
@@ -3,4 +3,5 @@
a: Int location=→TestData
field: Int
some(): Unit location=→TestData
TestData
-TestData
constructor TestData(Int)
@@ -3,10 +3,13 @@
-A2
a: Int
b: [ERROR : Annotation is absent]
constructor A2(Int, [ERROR : Type annotation was missing for parameter b] = ...)
-A3
a: Int
b: String
constructor A3(Int)
-A4
constructor A4(T?)
t: T?
-A5
Inner1
@@ -39,3 +42,4 @@
withDefaulArgs(Int = ..., String = ...): Unit
-WithDefaultArgs
a: Int
constructor WithDefaultArgs(Int = ..., String = ...)
@@ -1,5 +1,6 @@
-Simple.kt
-Test
constructor Test(String)
foo(): Int
other(): Unit
some: Int