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
Enumeration.values is confused by methods returning Val instances #3616
Comments
Imported From: https://issues.scala-lang.org/browse/SI-3616?orig=1
|
@dragos said: |
@harrah said: Unless someone else can reproduce it, what version of Scala and Java and can you post a full example that runs outside the REPL? |
Thomas Jung (thomas jung) said: Welcome to Scala version 2.8.0.RC6 (Java HotSpot(TM) Client VM, Java 1.6.0_18).
Type in expressions to have them evaluated.
Type :help for more information.
scala> object X extends Enumeration {
| val Y = Value
| }
defined module X
scala> object Fruit extends Enumeration {
| val x = X.Y
| val A,B,C = Value
| }
defined module Fruit
scala> Fruit.values
res0: Fruit.ValueSet = object$$Fruit.ValueSet(x, B, C) |
@paulp said: |
phmietti said: Welcome to Scala version 2.8.1.RC1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_20).
Type in expressions to have them evaluated.
Type :help for more information.
scala> object X extends Enumeration {
| val a, b = Value
| }
defined module X
scala> object Y extends Enumeration {
| val a = Value("a")
| val b = Value("b")
| }
defined module Y
scala> X.values
res0: X.ValueSet = X.ValueSet(a, b)
scala> X.values
res1: X.ValueSet = X.ValueSet(a, b, Value)
scala> Y.values
res2: Y.ValueSet = Y.ValueSet(a, b)
scala> Y.values
res3: Y.ValueSet = Y.ValueSet(a, b) |
The text was updated successfully, but these errors were encountered: