Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Fails To Run With Generics #19

Open
craigmiller160 opened this issue Jul 7, 2021 · 0 comments
Open

Fails To Run With Generics #19

craigmiller160 opened this issue Jul 7, 2021 · 0 comments

Comments

@craigmiller160
Copy link

Love the concept here, but I need it to work for a class with a generic type argument:

import com.thinkinglogic.builder.annotation.Builder

@Builder
data class CoreSearchResponse<T>(
        val results: List<T>,
        val totalAvailableRecords: Long
)

When I compile this, I get the following error:

[ERROR] [kapt] An exception occurred: java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$TypeVariableSymbol cannot be cast to javax.lang.model.element.TypeElement

When I don't use a generic type, it works perfectly. This one compiles without issue:

import com.thinkinglogic.builder.annotation.Builder

@Builder
data class CoreSearchResponse(
        val results: List<String>,
        val totalAvailableRecords: Long
)

Not sure what can be done about this. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant