Adding annotations to the type parameter of `HttpC...
# ktor
e
Adding annotations to the type parameter of
HttpClient.get<T>()
causes compilation to fail with
Annotated types are not supported in typeOf
Copy code
http.get<BaseResponse<@Serializable(with = ItemSerializer::class) Item>>("/v1/items/$id")
Failed to find anything related on google/youtrack/github . Filed a YT-issue here, but would be happy to close if someone can help me figure out what I’m doing wrong, or why this shouldn’t work, in general..
a
You can just annotate the definition of the
Item
class.
e
Tried that.. broke something else 😅
Copy code
org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
a
I suggest creating an issue for the
BackendException
here.
e
Thanks @Aleksei Tirman [JB], I’ll try to make a small repro and post there.
Done ✌️thanks for pointing me in the right direction. https://youtrack.jetbrains.com/issue/KT-49911