You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For this input, moshi ksp fails to compile (cannot find R while trying to resolve T).
@JsonClass(generateAdapter = true)
open class Node<T : Node<T, R>, R : Node<R, T>> {
var t : T? = null
var r : R? = null
}
@JsonClass(generateAdapter = true)
class StringNodeNumberNode(
) : Node<StringNodeNumberNode, NumberStringNode>() {
var text: String = ""
}
@JsonClass(generateAdapter = true)
class NumberStringNode(
) : Node<NumberStringNode, StringNodeNumberNode>() {
var number: Int = 0
}
I tried to patch thee compiler by registering type vars before resolving them, seems to fix it but it is not a clean implementation: yigit@7bf262e
For this input, moshi ksp fails to compile (cannot find R while trying to resolve T).
I tried to patch thee compiler by registering type vars before resolving them, seems to fix it but it is not a clean implementation:
yigit@7bf262e
Failing test case before the fix:
https://github.com/yigit/MoshiX/blob/self-referencing-types/moshi-ksp/tests/src/test/kotlin/dev/zacsweers/moshix/ksp/DualKotlinTest.kt#L365
The text was updated successfully, but these errors were encountered: