``` annotation class Thingy(val type: KClass&l...
# announcements
g
Copy code
annotation class Thingy(val type: KClass<*>)

    @Test fun `when using annotation class should work properly`(){

        val thingies = AnnotatedThingy::class.annotations.filterIsInstance<Thingy>()

        val KotlinIntType = Int::class
        val JVMIntType = KotlinIntType.java

        assertThat(thingies.single().type).isNotEqualTo(KotlinIntType).isEqualTo(JVMIntType)

        val retrievedType: Any = thingies.single().type

        assertThat(retrievedType).isNotEqualTo(JVMIntType).isEqualTo(KotlinIntType)

    }

    @Thingy(Int::class)
    class AnnotatedThingy(val x: Int)