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

Compliation issue regarding nullibility of Long column, after upgrading from 2.0.0 to 2.0.1 #4911

Closed
marcardar opened this issue Dec 14, 2023 · 1 comment
Labels

Comments

@marcardar
Copy link

SQLDelight Version

2.0.1

Operating System

Android

Gradle Version

8.2.1

Kotlin Version

1.9.21

Dialect

sqlite-3-38-dialect

AGP Version

8.2.1

Describe the Bug

After upgrading from 2.0.0 to 2.0.1, I get a compilation error.

loadFoo:
SELECT T.*, ifnull(cnt, 0) AS count
FROM t T
LEFT OUTER JOIN (
    SELECT foo_id, count(*) AS cnt
    FROM i I
    GROUP BY foo_id
) ON T.id = foo_id
ORDER BY T.code;
queries.loadFoo { id: Long, code: String, count: Long ->
    ...
}
Type mismatch: inferred type is (Long, String, Long, String?, Long) -> Foo but (Long, String, Long?) -> TypeVariable(T) was expected

So it looks like sqldelight no longer realises that ifNull(..) will always be non-null?

Workaround is to just change to count type to Long?

Stacktrace

No response

Gradle Build Script

No response

@marcardar marcardar added the bug label Dec 14, 2023
@eygraber
Copy link
Contributor

This was fixed with #4882

@AlecKazakova @hfhbd any chance there could be a patch release for this?

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

3 participants