This channel is now CLOSED. Please use gitter.im/scala/scala for user questions and gitter.im/scala/contributors for compiler development.
bishabosha on release-3.2.0
Irrefutable for generators shou… Merge pull request #15602 from … (compare)
I went to take a look at Dotty at the suggested site [https://dotty.epfl.ch/] and the Features section of the homepage contains two broken links [http://dotty.epfl.ch/docs/reference/other-new-features/auto-parameter-tupling.html, http://dotty.epfl.ch/docs/reference/other-new-features/multiversal-equality.html].
It creates a poor initial impression of Dotty's maturity.
Hi, would there be a way, via the new export
feature to achieve smthg like:
final class MyClass(a: String) { def f = println(a) }
trait MyTrait { def g = println("boo") }
val x = new MyClass("hello world")
class MixMyTrait[T](x: T) extends MyTrait { export x._ }
new MixMyTrait(x).f
|^^^^^^^^^^^^^^^^^^^
|value f is not a member of MixMyTrait[T]
I tried with a ClassTag
as well, but doesn't help
case class Point(x0: Int, x1: Int, x2: Int, x3: Int, x4: Int)
Point(1, 2, 3, 4, 5) match { case Point(x, rest: _*) if x > 0 => true; case _ => false }
^^^^^^^^^^^^^^^^^^
// Wrong number of argument patterns for Point; expected: (Int, Int, Int, Int, Int)
@xavierguihot compare scalac -Xlint
scala> case class C(i: Int, js: Int*)
defined class C
scala> C(42) match { case C(x, y, rest @ _*) => }
^
warning: Sequence wildcard (_*) does not align with repeated case parameter or extracted sequence; the result may be unexpected.
scala.MatchError: C(42,ArraySeq()) (of class C)
... 30 elided
and dotty
scala> case class C(i: Int, js: Int*)
// defined case class C
scala> C(42) match { case C(x, y, rest : _*) => }
1 |C(42) match { case C(x, y, rest : _*) => }
| ^^^^^^^^^^^^^^^^^^
| Wrong number of argument patterns for C; expected: (Int, Int*)
I haven't followed the changes, but indiscriminate scarfing of pattern args is pretty dicey.