From 3b513ba29998d4028a57e574d4d83e3b25f8761d Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Fri, 16 Jul 2021 23:53:52 +0200 Subject: [PATCH] Minor, add test on typeOf subtyping with mutable collections --- .../box/reflection/typeOf/mutableCollections_after.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/testData/codegen/box/reflection/typeOf/mutableCollections_after.kt b/compiler/testData/codegen/box/reflection/typeOf/mutableCollections_after.kt index 6b6f2a8f048..66d1e5a4a3c 100644 --- a/compiler/testData/codegen/box/reflection/typeOf/mutableCollections_after.kt +++ b/compiler/testData/codegen/box/reflection/typeOf/mutableCollections_after.kt @@ -7,6 +7,8 @@ package test import kotlin.reflect.KType import kotlin.reflect.typeOf +import kotlin.reflect.full.isSubtypeOf +import kotlin.reflect.full.isSupertypeOf import kotlin.test.assertEquals fun check(expected: String, actual: KType) { @@ -32,5 +34,10 @@ fun box(): String { check("kotlin.collections.MutableMap", typeOf>()) check("kotlin.collections.MutableMap.MutableEntry>", typeOf>>()) + check(typeOf>().isSubtypeOf(typeOf>())) + check(!typeOf>().isSubtypeOf(typeOf>())) + check(typeOf>().isSupertypeOf(typeOf>())) + check(!typeOf>().isSupertypeOf(typeOf>())) + return "OK" }