Zac Sweers
11/21/2020, 10:37 PMTing-Yuan Huang
11/22/2020, 12:49 AMTing-Yuan Huang
11/22/2020, 1:12 AM./gradlew build
but the error message is different from what you posted. I got
> Task :moshi-ksp:tests:compileTestKotlin FAILED
e: /usr/local/google/home/laszio/working/MoshiX/moshi-ksp/tests/src/test/kotlin/dev/zacsweers/moshix/ksp/codegen/GeneratedAdaptersTest.kt: (988, 28): Unresolved reference: GeneratedAdaptersTest_MultiplePropertiesShareAdapterJsonAdapter
...
Is ./gradlew build
the right way to produce?Zac Sweers
11/22/2020, 1:14 AM./gradlew :moshi-ksp:tests:compileTestKotlin
), but that message is correct. Just a different manifestation of itZac Sweers
11/22/2020, 1:14 AMTing-Yuan Huang
11/22/2020, 1:15 AMTing-Yuan Huang
11/22/2020, 1:45 AMUntypedNestedPersonResponse
, I cannot find the corresponding class in the build dir, though. Tried find . -name "*UntypedNestedPersonResponse*"
in moshi-ksp/tests
but only found
./build/generated/ksp/src/test/resources/META-INF/proguard/moshi-dev.zacsweers.moshix.ksp.codegen.UntypedNestedPersonResponse.pro
./build/generated/ksp/src/test/kotlin/dev/zacsweers/moshix/ksp/codegen/UntypedNestedPersonResponseJsonAdapter.kt
./build/generated/ksp/classes/test/dev/zacsweers/moshix/ksp/codegen/UntypedNestedPersonResponseJsonAdapterBridge.class
Ting-Yuan Huang
11/22/2020, 1:45 AMZac Sweers
11/22/2020, 1:46 AMUntypedNestedPersonResponseJsonAdapterBridge
is the correctly generated classZac Sweers
11/22/2020, 1:47 AMUntypedNestedPersonResponseJsonAdapter.kt
is the generated kotlin file that tries to reference itZac Sweers
11/22/2020, 1:47 AMUntypedNestedPersonResponse
is not generated, it's the annotated type in source that triggers generation of the above twoTing-Yuan Huang
11/22/2020, 1:50 AMUntypedNestedPersonResponseJsonAdapter.kt: (83, 63): Cannot access class 'dev.z
acsweers.moshix.ksp.codegen.UntypedNestedPersonResponse'. Check your module classpath for missing or conflicting dependencies
looks like that it's UntypedNestedPersonResponse
not found, rather than UntypedNestedPersonResponseJsonAdapterBridge
Ting-Yuan Huang
11/22/2020, 1:54 AMUntypedNestedPersonResponse
. I think the reference to UntypedNestedPersonResponse
comes from UntypedNestedPersonResponseJsonAdapterBridge
so looks like that UntypedNestedPersonResponseJsonAdapterBridge
is correctly loaded?Ting-Yuan Huang
11/22/2020, 2:03 AMUntypedNestedPersonResponse
. It's weird that it's not found.Zac Sweers
11/22/2020, 2:05 AMUntypedNestedPersonResponse
on the same classpathZac Sweers
11/22/2020, 2:05 AMNoClassDefFound
or whateverTing-Yuan Huang
11/22/2020, 2:19 AMUntypedNestedPersonResponse
is generic:
data class UntypedNestedPersonResponse<T : Personable>
However, the javap output looks suspicious:
static dev.zacsweers.moshix.ksp.codegen.UntypedNestedPersonResponse constructorBridge(java.lang.String, int);
I tried the following
class S {
fun x(): Generic<Int> = TODO()
fun y(): Generic<*> = TODO()
}
data class Generic<T: Number>(val x: Int = 0)
and javap reports
public final class S {
public final Generic<java.lang.Integer> x();
public final Generic<?> y();
...
}
Ting-Yuan Huang
11/22/2020, 2:24 AMZac Sweers
11/22/2020, 2:45 AMTing-Yuan Huang
11/22/2020, 4:09 AMZac Sweers
11/22/2020, 8:57 AMTing-Yuan Huang
11/23/2020, 7:21 PMZac Sweers
11/23/2020, 11:47 PMTing-Yuan Huang
11/23/2020, 11:49 PMconstructorBridge
in UntypedNestedPersonResponseJsonAdapterBridge
. How is it generated?Zac Sweers
11/24/2020, 2:34 AMZac Sweers
11/24/2020, 2:35 AMZac Sweers
11/24/2020, 4:26 AMZac Sweers
11/24/2020, 7:42 AMZac Sweers
11/24/2020, 7:44 AMkotlin/String
need to be converted firstTing-Yuan Huang
11/25/2020, 6:13 AMZac Sweers
11/26/2020, 7:38 AMZac Sweers
11/26/2020, 7:39 AMTing-Yuan Huang
12/01/2020, 4:56 AMZac Sweers
12/01/2020, 5:35 AM