This channel is now CLOSED. Please use gitter.im/scala/scala for user questions and gitter.im/scala/contributors for compiler development.
bishabosha on main
requests-scala fails due to exp… Merge pull request #15205 from … (compare)
odersky on main
Fix handling imports in TreeUnp… Merge pull request #15137 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.
Ive started experimenting with Dotty in VSCode. Im really impressed by the library compatibility with Scala 2.x using withDottyCompat
in build.sbt
. I have been able to throw Typelevel libs into a Dotty project and so far (almost) everything "just works"...
.. but it seems like the IDE isn't reloading/reimporting build.sbt
changes, as editor is complaining about missing library imports, while SBT CLI is fine. Is there a key-combo I should hit to trigger reimport of the SBT build?