File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
main/kotlin/com/papsign/ktor/openapigen/schema/builder/provider Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import kotlin.reflect.jvm.jvmErasure
1313object DefaultEnumSchemaProvider: SchemaBuilderProviderModule, OpenAPIGenModuleExtension {
1414
1515 private object Builder: SchemaBuilder {
16- override val superType: KType = getKType<Enum <* >>()
16+ override val superType: KType = getKType<Enum <* >? > ()
1717
1818 override fun build (
1919 type : KType ,
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ class GeneralBehaviorTest {
4646 assert (! getKType<FloatArray >().isSubtypeOf(getKType<Array <Any >>()))
4747 assert (! getKType<Array <Any >>().isSubtypeOf(getKType<Iterable <Any >>()))
4848 assert (getKType<List <Any >>().isSubtypeOf(getKType<Iterable <Any >>()))
49+ assert (getKType<List <Any >>().isSubtypeOf(getKType<Iterable <Any ?>>()))
4950 }
5051
5152 @Test
@@ -60,4 +61,19 @@ class GeneralBehaviorTest {
6061 fun testEnumSubtypes () {
6162 assert (getKType<TestEnum >().isSubtypeOf(getKType<Enum <* >>()))
6263 }
64+
65+
66+ lateinit var nothing: Nothing
67+ val nullableNothing: Nothing? = null
68+
69+ val nothingType = ::nothing.returnType
70+ val nullNothingType = ::nullableNothing.returnType
71+
72+ @Test
73+ fun testNothingSubtypes () {
74+ println (nothingType)
75+ println (nullNothingType)
76+ assert (nothingType.isSubtypeOf(nullNothingType))
77+ assert (! nullNothingType.isSubtypeOf(nothingType))
78+ }
6379}
You can’t perform that action at this time.
0 commit comments