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

Custom types in AS-clause inconsistently recognized #4111

Closed
neilgmiller opened this issue Apr 26, 2023 · 2 comments
Closed

Custom types in AS-clause inconsistently recognized #4111

neilgmiller opened this issue Apr 26, 2023 · 2 comments

Comments

@neilgmiller
Copy link

SQLDelight Version

2.0.0-alpha05

IDE Version

Android Studio Electric Eel | 2022.1.1 Patch 2

Dialect

SQLite

Describe the Bug

When adding a type alias: userID INTEGER AS UserID NOT NULL the type appears to be recognized (tool tip identifies the correct class) however the generated code doesn't and just has this import import UserID. In that same table for this column stackID INTEGER AS StackID NOT NULL, the type StackID, when not imported, is highlighted red as an unresolved reference. (Both are value classes in the same package)
Manually adding the import corrects the generated code as expected.

A similar issue can be seen with Kotlin basic type such as Int or Boolean.

Stacktrace

No response

@hfhbd
Copy link
Collaborator

hfhbd commented May 3, 2023

Sounds like a duplicate of #3438. Please try out the snapshot version or add a comment.

@hfhbd hfhbd closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2023
@neilgmiller
Copy link
Author

@hfhbd Tried the latest snapshot of the plugin. The kotlin.Int side is fixed. The custom type is still behaving weirdly, but differently.

I have two customs: BarID and FooBarID (key part may be that they both end in BarID?)
If the .sq file looks like this, it shows no warning and the tool tip over BarID shows docs for FooBarID

import com.example.FooBarID

CREATE TABLE FooBar (
    id INTEGER AS FooBarID PRIMARY KEY NOT NULL,
    barID INTEGER AS BarID NOT NULL,

If the file looks like this, FooBarID will be highlighted in red as an unresolved reference in the create statement

import com.example.BarID

CREATE TABLE FooBar (
    id INTEGER AS FooBarID PRIMARY KEY NOT NULL,
    barID INTEGER AS BarID NOT NULL,

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

No branches or pull requests

2 participants