@@ -197,6 +197,27 @@ class SignatureTest : BaseAbstractTest() {
197
197
}
198
198
}
199
199
200
+ @Test
201
+ fun `fun with use site variance modifier in` () {
202
+ val source = source(" fun simpleFun(params: Array<in String>): Unit" )
203
+ val writerPlugin = TestOutputWriterPlugin ()
204
+
205
+ testInline(
206
+ source,
207
+ configuration,
208
+ pluginOverrides = listOf (writerPlugin)
209
+ ) {
210
+ renderingStage = { _, _ ->
211
+ writerPlugin.writer.renderedContent(" root/example/simple-fun.html" ).firstSignature().match(
212
+ " fun " , A (" simpleFun" ), " (" , Parameters (
213
+ Parameter (" params: " , A (" Array" ), " <in " , A (" String" ), " >" ),
214
+ ), " )" ,
215
+ ignoreSpanWithTokenStyle = true
216
+ )
217
+ }
218
+ }
219
+ }
220
+
200
221
@Test
201
222
fun `fun with definitely non-nullable types` () {
202
223
val source = source(" fun <T> elvisLike(x: T, y: T & Any): T & Any = x ?: y" )
@@ -312,6 +333,28 @@ class SignatureTest : BaseAbstractTest() {
312
333
}
313
334
}
314
335
336
+ @Test
337
+ fun `class with declaration site variance modifier` () {
338
+ val writerPlugin = TestOutputWriterPlugin ()
339
+
340
+ testInline(
341
+ """
342
+ |/src/main/kotlin/common/Test.kt
343
+ |package example
344
+ |
345
+ |class PrimaryConstructorClass<out T> { }
346
+ """ .trimMargin(),
347
+ configuration,
348
+ pluginOverrides = listOf (writerPlugin)
349
+ ) {
350
+ renderingStage = { _, _ ->
351
+ writerPlugin.writer.renderedContent(" root/example/-primary-constructor-class/index.html" ).firstSignature().match(
352
+ Span (" class " ), A (" PrimaryConstructorClass" ), Span (" <" ), Span (" out " ), A (" T" ), Span (" >" ),
353
+ )
354
+ }
355
+ }
356
+ }
357
+
315
358
@Test
316
359
fun `functional interface` () {
317
360
val source = source(" fun interface KRunnable" )
@@ -896,8 +939,7 @@ class SignatureTest : BaseAbstractTest() {
896
939
) {
897
940
renderingStage = { _, _ ->
898
941
writerPlugin.writer.renderedContent(" root/example/-primary-constructor-class/index.html" ).firstSignature().match(
899
- // In `<T>` expression, an empty `<span class="token keyword"></span>` is present for some reason
900
- Span (" class " ), A (" PrimaryConstructorClass" ), Span (" <" ), Span (), A (" T" ), Span (" >" ), Span (" (" ), Parameters (
942
+ Span (" class " ), A (" PrimaryConstructorClass" ), Span (" <" ), A (" T" ), Span (" >" ), Span (" (" ), Parameters (
901
943
Parameter (Span (" val " ), " x" , Span (" : " ), A (" Int" ), Span (" ," )),
902
944
Parameter (Span (" var " ), " s" , Span (" : " ), A (" String" ))
903
945
), Span (" )" ),
0 commit comments