https://kotlinlang.org logo
#stdlib
Title
# stdlib
a

azabost

02/22/2017, 10:27 AM
I have a class
class EnumStringConverter<E extends Enum> implements Converter<E, String>
which I must provide for this annotation:
Copy code
public @interface Convert {
    Class<? extends Converter> value();
}
When I do it like this:
@get:Convert(EnumStringConverter::class)
I get:
Copy code
Error:(95, 19) error: constructor EnumStringConverter in class EnumStringConverter<E> cannot be applied to given types;
required: Class
found: no arguments
reason: actual and formal argument lists differ in length
where E is a type-variable:
E extends Enum declared in class EnumStringConverter
And I don't know how to properly provide the type. Could you help please?
i

ilya.gorbunov

02/22/2017, 2:17 PM
azabost: by the way, why stdlib channel?
a

azabost

02/22/2017, 3:16 PM
First, I thought it may be related to reflection API. Second, I was going to move this question to the 'general' channel, but I have already got some answer, so I left it.
5 Views