Namely I would like to write my own valueOf for enums, since this method is removed now by Scala designers (odd call -- https://issues.scala-lang.org/browse/SI-4571).
def valueOf[E <: Enumeration](s : String) =
E#Value.values.filter(it => it.toString==s).single()
Don't pay much attention to single, it is just Linq-like wrapper (see: Chart of IEnumerable LINQ equivalents in Scala?).
The problem is with E#Value.
Question
How do I access this alias correctly, i.e how do I access type alias of generic type? Please treat this Enum as example!
There is withName method, even if it is considered replacement it is broken by design, value is not a name, so I won't use it to avoid further confusion what the code is doing.