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
package foo.bar;
import androidx.room.*;
import java.util.*;
public class MyPojo {
int id;
@Relation(parentColumn = "id", entityColumn = "uid")
public List<User> user;
}
When I resolve the type of user via asMemberOf (MyPojo) and then get the type argument type (from List), its isError check returns false instead of true.
When I debug, the ksType is (User..User?) and its declaration.descriptor is instance of NotFoundClasses$MockClassDescriptor but somehow KSP is missing it.
This CL moves PojoProcessorTest to xprocessing.
There are two differences with JavaAP.
Error detection for primitives do not work in KSP since all
types in KSP have a type element (a.k.a. no primitives).
Technically, we could check if their typename is primitive
but they already fail for lack of constructor so I changed
their errors instead in the test.
Also, there is an existing bug in KSP where it loses KSType.isError
information in some cases. Changed the expected error for that test
for now.
google/ksp#371
Bug: 160322705
Test: PojoProcessorTest
Change-Id: I4a102bf9a6e5e749711783ac55955284d4d0b5fb
can you give me more detail on this? I tried to call asMemberOf against a normal type on a typePair: Pair<BaseTypeArg2, NonExist> and it is returning isError=true for the second type argument in the return result of asMemberOf. Is my understanding of the issue here correctly?
Hit this issue while converting a room test to also run with KSP.
https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:room/compiler/src/test/kotlin/androidx/room/processor/PojoProcessorTest.kt;l=477?q=PojoProcessorTest
When I resolve the type of
user
viaasMemberOf
(MyPojo
) and then get the type argument type (from List), itsisError
check returnsfalse
instead oftrue
.When I debug, the
ksType
is(User..User?)
and itsdeclaration.descriptor
is instance ofNotFoundClasses$MockClassDescriptor
but somehow KSP is missing it.We probably need to expand this check:
https://github.com/google/ksp/blob/master/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/java/KSTypeReferenceJavaImpl.kt#L98
to always check the declaration?
I'll try to followup with a repro in KSP test infra.
The text was updated successfully, but these errors were encountered: