aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2016-11-17 12:44:08 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2016-11-24 20:15:50 +0300
commitbac315d15c7de87cacf152d31f08c4f703abee34 (patch)
tree235b1c1a0d639742e01ae18cdc4332d04f7dc1ba /core
parent89d41a1bc909c7e350b07bc29d39762449d64650 (diff)
downloaddokka-bac315d15c7de87cacf152d31f08c4f703abee34.tar.gz
dokka-bac315d15c7de87cacf152d31f08c4f703abee34.tar.bz2
dokka-bac315d15c7de87cacf152d31f08c4f703abee34.zip
Test for previous fix, in/out modifiers not lost
Diffstat (limited to 'core')
-rw-r--r--core/src/test/kotlin/model/TypeAliasTest.kt18
-rw-r--r--core/testdata/typealias/asTypeBoundWithVariance.kt7
2 files changed, 25 insertions, 0 deletions
diff --git a/core/src/test/kotlin/model/TypeAliasTest.kt b/core/src/test/kotlin/model/TypeAliasTest.kt
index e67572f1..812fd9dc 100644
--- a/core/src/test/kotlin/model/TypeAliasTest.kt
+++ b/core/src/test/kotlin/model/TypeAliasTest.kt
@@ -102,4 +102,22 @@ class TypeAliasTest {
}
}
}
+
+ @Test
+ fun testAsTypeBoundWithVariance() {
+ verifyModel("testdata/typealias/asTypeBoundWithVariance.kt") {
+ val pkg = it.members.single()
+ with(pkg.members(NodeKind.Class).find { it.name == "C" }!!) {
+ val tParam = detail(NodeKind.TypeParameter)
+ assertEquals("out", tParam.detail(NodeKind.Modifier).name)
+ assertEquals("B", tParam.detail(NodeKind.Type).link(NodeKind.TypeAlias).name)
+ }
+
+ with(pkg.members(NodeKind.Class).find { it.name == "D" }!!) {
+ val tParam = detail(NodeKind.TypeParameter)
+ assertEquals("in", tParam.detail(NodeKind.Modifier).name)
+ assertEquals("B", tParam.detail(NodeKind.Type).link(NodeKind.TypeAlias).name)
+ }
+ }
+ }
} \ No newline at end of file
diff --git a/core/testdata/typealias/asTypeBoundWithVariance.kt b/core/testdata/typealias/asTypeBoundWithVariance.kt
new file mode 100644
index 00000000..1aef84d6
--- /dev/null
+++ b/core/testdata/typealias/asTypeBoundWithVariance.kt
@@ -0,0 +1,7 @@
+package _typealias.astypebound
+class A
+
+typealias B = A
+
+class C<out T : B>
+class D<in T : B> \ No newline at end of file