-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:desugarDesugaring happens after parsing but before typing, see desugar.scalaDesugaring happens after parsing but before typing, see desugar.scalaarea:enumsitype:bug
Description
minimized code
import java.{lang => jl}
final class ConfigSyntax private (name: String, ordinal: Int)
extends jl.Enum[ConfigSyntax](name, ordinal)
object ConfigSyntax {
final val JSON = new ConfigSyntax("JSON", 0)
final val CONF = new ConfigSyntax("CONF", 1)
final val PROPERTIES = new ConfigSyntax("PROPERTIES", 2)
private[this] final val _values: Array[ConfigSyntax] =
Array(JSON, CONF, PROPERTIES)
def values: Array[ConfigSyntax] = _values.clone()
def valueOf(name: String): ConfigSyntax =
_values.find(_.name == name).getOrElse {
throw new IllegalArgumentException("No enum const ConfigSyntax." + name)
}
}
problem
Currently the compiler requires an alias or fully specified class name for java.lang.Enum
and errors when compiling.
too many arguments for constructor Enum: (): Enum[ConfigSyntax]
expectation
Should compile and not require a fully specified class name.
Metadata
Metadata
Assignees
Labels
area:desugarDesugaring happens after parsing but before typing, see desugar.scalaDesugaring happens after parsing but before typing, see desugar.scalaarea:enumsitype:bug