File tree Expand file tree Collapse file tree 1 file changed +0
-17
lines changed
BotCommands-core/src/test/kotlin/io/github/freya022/botcommands/core/reflect Expand file tree Collapse file tree 1 file changed +0
-17
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ package io.github.freya022.botcommands.core.reflect
33import io.github.freya022.botcommands.api.core.reflect.KotlinTypeToken
44import org.junit.jupiter.api.Test
55import org.junit.jupiter.api.assertDoesNotThrow
6- import org.junit.jupiter.api.assertThrows
76
87object KotlinTypeTokenTest {
98 @Test
@@ -12,20 +11,4 @@ object KotlinTypeTokenTest {
1211 assertDoesNotThrow { object : KotlinTypeToken <List <String >>() {} }
1312 assertDoesNotThrow { object : KotlinTypeToken <List <* >>() {} }
1413 }
15-
16- @Test
17- fun `Invalid KotlinTypeToken` () {
18- assertThrows<IllegalArgumentException > { genericFunction<String >() }
19- assertThrows<IllegalArgumentException > { reifiedGenericFunction<String >() }
20- }
21-
22- private fun <T > genericFunction () {
23- object : KotlinTypeToken <T >() {}
24- }
25-
26- // KType#classifier returns null, but KType#javaType works,
27- // while it should be supported, the APIs use KType, and you can't get one from a Type.
28- private inline fun <reified T > reifiedGenericFunction (): KotlinTypeToken <T > {
29- return object : KotlinTypeToken <T >() {}
30- }
3114}
You can’t perform that action at this time.
0 commit comments