https://kotlinlang.org logo
#announcements
Title
# announcements
b

blakelee

06/05/2017, 2:27 AM
Is there any way around this?
Copy code
An annotation parameter must be a class literal (T::class)
I want to do something like
Copy code
myclass<myType>::class.java
It's looking like I'm going to have to define a class for each of my types 😞
d

diesieben07

06/05/2017, 2:29 AM
blakelee: Unfortunately that is a limitation of the Java class file format, annotations can only contain constants as defined by the class file constant pool. That means you can only put classes in annotations, not actual types.
b

blakelee

06/05/2017, 2:30 AM
bummer. Thanks for the info
4 Views