Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type mismatch errors in the IDE #5

Open
hichamboushaba opened this issue Dec 8, 2022 · 4 comments
Open

Type mismatch errors in the IDE #5

hichamboushaba opened this issue Dec 8, 2022 · 4 comments
Labels

Comments

@hichamboushaba
Copy link

Hey, first of all, thanks for working on this, it's great to see the multiplatform ecosystem growing daily.

While integrating this library into a personal project, the IDE shows many "type mismatch" errors in the common code, I tried different combinations of Kotlin/AGP/AS and even Intellij IDEA versions, and the same happens in all of them. An example of the errors is:

Type mismatch.
Required:
app.cash.paging.PagingConfig /* = androidx.paging.PagingConfig */
Found:
app.cash.paging.PagingConfig

To investigate this, I cloned the main repo to try the sample app, and while it didn't occur when the library was imported as a project, it occurred when I updated the sample app to import the "module dependency` instead.
I also tried composite builds as an attempt to fix the issue in my project, but it didn't solve the issue.

This error looks similar to this bug report https://youtrack.jetbrains.com/issue/KT-46691/MPP-Type-mismatch-for-hierarchically-commonized-typealiases#focus=Comments-27-4921124.0-0, maybe the applied fix works only when referencing the module as a project and not as a module dependency.

@veyndan
Copy link
Collaborator

veyndan commented Jan 6, 2023

Sorry for the late reply — I just got back from a vacation so catching up on things.

Thanks for investigating this issue! Unfortunately, Intellij's support for expect/actualing type aliases isn't great. I created a YouTrack issue for this, so please star/follow along. I linked this new issue within the one that you linked.

@danailalexiev
Copy link

In addition to the type mismatch errors - I tried implementing a remote mediator and I could get the code to compile. I got the following issues when extending the RemoteMediator class:

internal class PagingRemoteMediator: RemoteMediator<String, Post>() // RemoteMediator doesn't have a constructor

internal class PagingRemoteMediator: RemoteMediator<String, Post> // RemoteMediator must be invoked as a constructor

@veyndan
Copy link
Collaborator

veyndan commented Feb 15, 2023

@danailalexiev Good catch! That should be fixed in the next release by #46.

@Nailik
Copy link

Nailik commented Aug 23, 2023

Same for compose multiplatform paging, i get type mismatches all over https://github.com/cashapp/multiplatform-paging/tree/main-3.2.0-alpha05.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants