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

Unresolved reference kotlin.Int #3438

Closed
vanniktech opened this issue Aug 13, 2022 · 6 comments · Fixed by #3924
Closed

Unresolved reference kotlin.Int #3438

vanniktech opened this issue Aug 13, 2022 · 6 comments · Fixed by #3924

Comments

@vanniktech
Copy link
Contributor

vanniktech commented Aug 13, 2022

SQLDelight Version

2.0.0-alpha03

IDE Version

IntelliJ 2022.2.1

Dialect

SQLite

Describe the Bug

import kotlinx.datetime.Instant;
import kotlin.Int;

CREATE TABLE coacheeAvatar (
  id TEXT NOT NULL PRIMARY KEY,
  coacheeId TEXT,
  mimeType TEXT NOT NULL,
  length INTEGER NOT NULL,
  width INTEGER AS Int NOT NULL,
  height INTEGER AS Int NOT NULL,
  path TEXT NOT NULL,
  created INTEGER AS Instant NOT NULL
);

yields:

Screen Shot 2022-08-13 at 08 16 45

Somehow, sqldelight is able to get the Instant type, but not the Int type. There are no logs or whatsoever that I can trace to sqldelight in my idea.log file.

I use 2.0.0-alpha03 for my dependencies and 2.0.0-SNAPSHOT-1660129311905 for the IntelliJ plugin since otherwise it's completely broken because it's missing #3422

@shakil807g
Copy link

Same issue on 2.0.0-alpha04, getting Unresolved reference kotlin.Int

@kirillzh
Copy link

Screenshot 2023-02-22 at 6 48 24 PM

Seeing this with other Kotlin types

aperfilyev added a commit to aperfilyev/sqldelight that referenced this issue Feb 25, 2023
aperfilyev added a commit to aperfilyev/sqldelight that referenced this issue Feb 25, 2023
AlecKazakova pushed a commit that referenced this issue Mar 13, 2023
@hi-brylle
Copy link
Contributor

hi-brylle commented Mar 17, 2023

This is still happening for Int.

sq file
image

generated code
image

SQLDelight version: 2.0.0-alpha05 for Android

I worked around this by simply removing AS Int in my sq file, but this doesn't suit my purposes.

@vanniktech
Copy link
Contributor Author

You need to use the snapshot version ...

@aperfilyev
Copy link
Collaborator

aperfilyev commented Mar 19, 2023

Please try EAP version of the plugin https://plugins.jetbrains.com/plugin/8191-sqldelight/versions/eap or #3610 (comment)

Edit: you must also explicitly import primitive types after upgrading to 2.0

@humblehacker
Copy link

Can any part of this be backported to plugin version 1.5? I'm having issues importing identifiers from other modules. Compiles fine but shows up red in the IDE. I can confirm this problem is gone 2.0 and the latest plugin snapshot, but we're staying on 1.5 for the moment.

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

Successfully merging a pull request may close this issue.

6 participants