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

Is "type" word a reserved? #909

Open
14v opened this issue Jan 24, 2020 · 2 comments
Open

Is "type" word a reserved? #909

14v opened this issue Jan 24, 2020 · 2 comments

Comments

@14v
Copy link

14v commented Jan 24, 2020

When I declare some entity with field type e.g.

@Entity
interface Foo {
  // @get:Key...

  @get:Converter(...)
  val type : Type

  enum class Type { BAR, BAZ }
}

Compilation fails with

app/build/generated/source/kapt/debug/.../data/db/FooEntity.java:195: error: type Type does not take parameters
    public static final Type<FooEntity> $TYPE = new TypeBuilder<FooEntity>(FooEntity.class, "Foo")

Then if I refactor Type to e.g. FooType and clean - build I got warning dialogs from IDEA that memory and disk changes conflicts and same error repeats.

Should type word be checked at compile time to be escaped, etc?

@npurushe
Copy link
Contributor

npurushe commented Mar 4, 2020

I think in this case it's conflicting with your inner definition of Type, could be solved by fully qualifying the requery Type class

@14v
Copy link
Author

14v commented Mar 4, 2020

I don't use Requery's io.requery.meta.Type manually. Tried to use full path or outer class reference of Foo.Type - error remains, extra paths are shown as redundant. Look at sample in related commit.

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

No branches or pull requests

2 participants