`getJavaWildcard` does not account for overrides
See original GitHub issueWhen a java source overrides a kotlin file, inherited functions should also inherit the variance even when the overrider’s type deos not require it (e.g. it is final)
repro test: https://github.com/yigit/ksp/commit/a2b4324a0d50258a75e204237254f8c3d8188b89
Inputs:
// FILE: javaOverridesKotlin.kt
package main
interface BaseKotlinOverriddenByJava<T> {
fun receiveReturnT(t: T): T
fun receiveReturnTList(t: List<T>): List<T>
}
interface KotlinOverriddenByKotlinOpen : BaseKotlinOverriddenByJava<Number> {
}
interface KotlinOverriddenByKotlinFinal : BaseKotlinOverriddenByJava<String> {
}
// FILE: main/JavaOverridesKotlinOpen.java
package main;
import java.util.List;
public interface JavaOverridesKotlinOpen extends BaseKotlinOverriddenByJava<Number> {
}
// FILE: main/JavaOverridesKotlinFinal.java
package main;
import java.util.List;
public interface JavaOverridesKotlinFinal extends BaseKotlinOverriddenByJava<String> {
}
the signature of receiveReturnTList
as member of JavaOverridesKotlinFinal
(or KotlinOverriddenByKotlinFinal
) still needs to return out
variance for the String
type parameter.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
Provide APIs to resolve positional types for parameters #717
Specifically, parameters of methods might include variance based on the declaration or the overridee. There are also JvmSuppressWildcards ...
Read more >React App and Chrome DevTools local overrides not working?
I have tried to do local overrides through the chrome dev tools on other non react sites, there it is working. Am I...
Read more >Using Local Overrides in DevTools | A Faster Web
Quickly and easily experiment on remote sites with Chrome's new overrides feature.
Read more >Override doesn't get invoked - Oracle Communities
I've been trying to get a simple override to work. I used S_PurchaseOrder as a template.
Read more >Web Rating Overrides are not functioning after FortiOS upgrade
instead, the categories provided by Fortiguard are still used. I noticed that the ref (Reference) count for each override in the table is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@yigit I created issue and attached sample project: https://issuetracker.google.com/issues/217210973
Do you still have this problem with room 2.4.1? We couldn’t use the KSP API but implemented a custom one in room. If it is still not working for your case, it would be great to have a bug report so we can fix it in room. 🙏