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

Cannot compile types with external ref through findValues #96

Closed
zifeo opened this issue Jan 4, 2017 · 3 comments
Closed

Cannot compile types with external ref through findValues #96

zifeo opened this issue Jan 4, 2017 · 3 comments
Labels

Comments

@zifeo
Copy link

zifeo commented Jan 4, 2017

Version: latest

sealed abstract class A private (val value: Int) extends IntEnumEntry {
  val text: String
}

object A extends IntEnum[A] {

  val values = findValues

  case object A1 extends A(1) {
    val text = identity("something") // Error:(9, 16) object A1 has a value with the wrong type: something:class java.lang.String, instead of int.
    //val text = "something"
  }

  def identity(str: String) = str

}

No workaround known, blocker.

@lloydmeta
Copy link
Owner

lloydmeta commented Jan 4, 2017

I see, I think the problem is here where I crawl through the body looking for apply statements. There needs to be a check to make sure that this is a constructor application for the current enum type.

@lloydmeta lloydmeta added the bug label Jan 4, 2017
lloydmeta added a commit that referenced this issue Jan 4, 2017
- Make the member trees search use  an iterator so we only grab the very first one
@lloydmeta lloydmeta mentioned this issue Jan 4, 2017
@lloydmeta
Copy link
Owner

Just released v1.5.5 with a fix for this issue. Thanks for reporting it :)

@zifeo
Copy link
Author

zifeo commented Jan 4, 2017

Wow, thanks was fast! Thanks 👍

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

2 participants