a

    azabost

    5 years ago
    I have a class
    class EnumStringConverter<E extends Enum> implements Converter<E, String>
    which I must provide for this annotation:
    public @interface Convert {
        Class<? extends Converter> value();
    }
    When I do it like this:
    @get:Convert(EnumStringConverter::class)
    I get:
    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?
    ilya.gorbunov

    ilya.gorbunov

    5 years ago
    azabost: by the way, why stdlib channel?
    a

    azabost

    5 years ago
    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.