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.kt
-InheritedJavaMembers -InheritedJavaMembers
call(): String! location=→Callable call(): String! location=→Callable
constructor InheritedJavaMembers()
equals(Any?): Boolean location=→Any equals(Any?): Boolean location=→Any
hashCode(): Int location=→Any hashCode(): Int location=→Any
test(): Unit test(): Unit
@@ -3,4 +3,5 @@
a: Int location=→TestData a: Int location=→TestData
field: Int field: Int
some(): Unit location=→TestData some(): Unit location=→TestData
TestData -TestData
constructor TestData(Int)
@@ -3,10 +3,13 @@
-A2 -A2
a: Int a: Int
b: [ERROR : Annotation is absent] b: [ERROR : Annotation is absent]
constructor A2(Int, [ERROR : Type annotation was missing for parameter b] = ...)
-A3 -A3
a: Int a: Int
b: String b: String
constructor A3(Int)
-A4 -A4
constructor A4(T?)
t: T? t: T?
-A5 -A5
Inner1 Inner1
@@ -39,3 +42,4 @@
withDefaulArgs(Int = ..., String = ...): Unit withDefaulArgs(Int = ..., String = ...): Unit
-WithDefaultArgs -WithDefaultArgs
a: Int a: Int
constructor WithDefaultArgs(Int = ..., String = ...)
@@ -1,5 +1,6 @@
-Simple.kt -Simple.kt
-Test -Test
constructor Test(String)
foo(): Int foo(): Int
other(): Unit other(): Unit
some: Int some: Int