Enum reference


#1

Are enumerations broken? I'm trying to reference an enum in a different file, and in the source editor it appears to work fine, but compilation fails with:

Kotlin: Unresolved reference: GET

There seem to be lots of other problems with enums, so I’m wondering if I should even be bothering right now.


#2

Can you show sources? Which versions of the plugin and IDEA are you using?


#3

I'm trying to reduce this down to an easy to reproduce case, but it connected with annotations. I'm trying to include an enum as a parameter to an annotation, and there seem to be some issues. That said, trying to reproduce with a test case is proving difficult.

Inside IDEA, the files are shown as fine, with no errors indicated.

package com.a

enum class Bar {
ONE
TWO
THREE
}

package com.b

annotation class foo(val method: Bar)

package com.c

foo(Bar.ONE) fun doit() {
}

That’s the idea, but as I said, when trying to reproduce with a simple case like this, I’m not seeing the error. It’s not an easy one to figure out.


#4

I suspect this has more to do with problem with annotation than enum. If you check on youtrack, you will see plenty of cases in relation to annotation.


#5

Yeah, I started to come to that conclusion as I'm running into other issues with annotations. I guess for now String constants will have to do.


#6

Yes, it's bug of annotations. Can you submit bug to tracker ? Thanks!