Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 19:14
    philwalk commented #13562
  • 19:03
    odersky synchronize #13309
  • 18:54
    philwalk synchronize #13562
  • 18:14
    philwalk synchronize #13562
  • 18:09
    noti0na1 commented #13608
  • 18:07
    noti0na1 labeled #13608
  • 18:06
    noti0na1 commented #13608
  • 18:03
    odersky closed #13602
  • 18:03
    odersky commented #13602
  • 18:02
    odersky assigned #13608
  • 18:01
    odersky commented #13608
  • 18:01
    odersky commented #13608
  • 17:59
    odersky synchronize #13309
  • 17:54
    philwalk commented #13562
  • 17:45
    bblfish commented #13416
  • 17:45
    bblfish commented #13416
  • 17:42
    tgodzik synchronize #13369
  • 17:40
    bblfish commented #13608
  • 17:39
    bblfish commented #13608
  • 17:08
    odersky synchronize #13309
Guillaume Martres
@smarter
@/all 👋 This channel is now closed. We're moving to gitter.im/scala/scala for user questions and https://gitter.im/scala/contributors for compiler development. Additionally, we're experimenting with Github discussions and have recently added a Metaprogramming section to https://github.com/lampepfl/dotty/discussions, feel free to drop by!
Bjorn Regnell
@bjornregnell
:thumbsup:
Jakub Kozłowski
@kubukoz:matrix.org
[m]
A sign of the times!
Eric K Richardson
@ekrich
@smarter Thanks!
bblfish
@bblfish:matrix.org
[m]
This message was deleted
Dmitrii Naumenko
@unkarjedy
This message was deleted
Nikita Gazarov
@raquo
You gotta ask in scala/scala, this channel is archived
sinanspd
@sinanspd
oh god sorry i thought i was in the contributors
my bad
Mahdi Robatipoor
@robatipoor
auto completion not work in scala 3 If we do not use the new keyword create object intellij IDE
Does anyone have an idea how to solve this problem ?
Loránd Szakács
@lorandszakacs
@robatipoor Scala 3 support is still in work for pretty much all IDEs at the current time. So all sorts of these quirks will be present. You can maybe ask about intellij IDE here:
https://gitter.im/JetBrains/intellij-scala
Fabio Pinheiro
@FabioPinheiro
I think I found another inconsistent on the incremental compilation, this time with scala 3.0.0.
But the projects involve circe-generic and akka-stream (with CrossVersion.for3Use2_13) it may be hard to minimize.
Is there known issues about inconsistent on the incremental compilation?
I couldn't find any other than the one that I open. But maybe I'm not searching with the right keywords
Guillaume Martres
@smarter
there's one known issue involving inline defs: lampepfl/dotty#12931
otherwise there's the same limitations than scala 2 incremental compilation has: https://github.com/sbt/zinc/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Aarea%2Funder_compilation
oh yeah also this channel is closed and you should ask in https://gitter.im/scala/contributors :)
Fabio Rizzello
@fabio.rizzello.lav_gitlab

Hi is there a way to match types on unions and intersections?
Ex.

type MyType[T <: Boolean] = T match {
  case true => Int
  case false => String
}

val x: MyType[true] = 100
val y: MyType[false] = "a string"

Now what if I want to match on

val y: MyType[false | true] = ???
val y: MyType[false & true] = ???

Isn't there a way to match like

type MyType[T <: Boolean] = T match {
  case Intersection[a, b] => ???
  case Union[a, b] => ???
  case true => Int
  case false => String
}
Guillaume Martres
@smarter
@fabio.rizzello.lav_gitlab This channel is closed, please use https://gitter.im/scala/scala
Swoorup Joshi
@Swoorup
@smarter could that be updated in the description of the title?
Guillaume Martres
@smarter
done.
Swoorup Joshi
@Swoorup
:thumbsup:
Alexander Ioffe
@deusaquilus
@molikto Did you ever get your tool-box compiler equivalent to work?
Minghao Liu
@molikto
@deusaquilus no! but I didn't look into it a lot and it's a long time ago. so maybe it is worth asking again
Alexander Ioffe
@deusaquilus
The ScriptEngine will do exactly this! Just make sure to do fork := true if you're doing runMain with SBT on it:
https://github.com/lampepfl/dotty/blob/7627583448ddde71c3f19c8ec962f3b16f917652/tests/run-with-compiler/scripting.scala
©︎ureれも:=ネ=>℃🐳
@curelemonade2_twitter

I try migrate scala 2.13 to scala 3.0.0.
so stumble type-projector.

code

import cats.effect.kernel.MonadCancel
import cats.effect.IO
import cats.~>

import scala.language.implicitConversions
import scala.languageFeature.higherKinds

trait Transactor[M[_], N[_]] {
  def trans(using ev: MonadCancel[N, Throwable]): M ~> N
}

trait Transactable[M[_]] {
  def transact[A](transactor: Transactor[M, IO])(m: M[A])(using ev: MonadCancel[IO, Throwable]): IO[A]
}

object Transactable {
  // scala 2.13
  //  def apply[M[_]](implicit ev: Transactable[M[*]]): Transactable[M[*]] = implicitly[Transactable[M[*]]]

  // dotty
    def apply[M[_]](using ev: Transactable[({type L[F[_]] = M[F]})#L]): Transactable[({type R[F[_]] = M[F]})#R] =
    implicitly[Transactable[({type R[F[_]] = M[F]})#R]]
}

error

[error] -- Error: ******/Transactor.scala:24:62
[error] 24 |    def apply[M[_]](using ev: Transactable[({type L[F[_]] = M[F]})#L]): Transactable[({type R[F[_]] = M[F]})#R] =
[error]    |                                                              ^
[error]    |               Type argument F does not have the same kind as its bound
[error] -- Error: ******/Transactor.scala:24:104
[error] 24 |    def apply[M[_]](using ev: Transactable[({type L[F[_]] = M[F]})#L]): Transactable[({type R[F[_]] = M[F]})#R] =
[error]    |                                                                                                        ^
[error]    |               Type argument F does not have the same kind as its bound
[error] -- Error: ******/Transactor.scala:25:47
[error] 25 |    implicitly[Transactable[({type R[F[_]] = M[F]})#R]]
[error]    |                                               ^
[error]    |               Type argument F does not have the same kind as its bound

any idea?

Oron Port
@soronpo

@curelemonade2_twitter

This channel is CLOSED. Please use gitter.im/scala/scala for user questions and gitter.im/scala/contributors for compiler development.

©︎ureれも:=ネ=>℃🐳
@curelemonade2_twitter
@soronpo oh! thx!
Isaac Zeng
@gfZeng
for scala 2: implicit def foo(x: Int). what is the given version for scala 3?
Oron Port
@soronpo
@gfZeng
This channel is CLOSED. Please use gitter.im/scala/scala for user questions and gitter.im/scala/contributors for compiler development.
Oron Port
@soronpo
What is the projected timeline on 3.1.0-RC1 (or M1?)? There is at least one SIP I want to implement as an experimental feature for 3.1.
Guillaume Martres
@smarter
Because we follow semver, we'll bump to 3.1 as soon as we add a non-experimental API or a tag to tasty
There's no timeline
And experimental features and APIS can be added in patch releases
Since they don't have any compatibility guarantees
Oron Port
@soronpo
Thanks, and sorry I posted it here. I meant for it to be on contributors.
Tobias Kahlert
@SrTobi

Hi, could it be that the naming scheme is outdated in this doc: https://docs.scala-lang.org/scala3/reference/contextual/relationship-implicits.html#anonymous-given-instances ?

trait Ord[T]

object Test:
  given [T](using ord: Ord[T]): Ord[List[T]] with {  }

@main
def myMain(): Unit  =
  import Test.given_Ord_List_T

fails, but when I do import Test.given_Ord_Listit works. Is this a bug or is there a new naming scheme?

Guillaume Martres
@smarter
The doc is outdated
Tobias Kahlert
@SrTobi
@smarter are there updated docs somewhere? or is it in the compiler? where do I have to look?
Guillaume Martres
@smarter
You should make a PR to get the docs to match what the compiler does :)
Also this channel is closed, please use scala/scala
Ken Scambler
@kenbot

Hi folks,
In Scala 3 match types don't seem to work with type hierarchies.

class Food; class Cereal extends Food;
type FoodType[F] = F match
case Cereal => Int // More specific one first
case Food => String // I would expect it to fall through

val x: FoodType[Cereal] = 3 //compiles
val y: FoodType[Food] = "abc" // ERROR

Should I raise a bug, or have I misunderstood the intended behaviour?

Sorry - I see the channel is closed; I'll repost in scala/scala
Oron Port
@soronpo
The channel title is not so visible, so people are missing this channel is closed. To resolve this, I will briefly spam the channel with the title. Sorry for the annoyance it may cause:
This channel is now CLOSED. Please use gitter.im/scala/scala for user questions and gitter.im/scala/contributors for compiler development.
This channel is now CLOSED. Please use gitter.im/scala/scala for user questions and gitter.im/scala/contributors for compiler development.
This channel is now CLOSED. Please use gitter.im/scala/scala for user questions and gitter.im/scala/contributors for compiler development.
This channel is now CLOSED. Please use gitter.im/scala/scala for user questions and gitter.im/scala/contributors for compiler development.
This channel is now CLOSED. Please use gitter.im/scala/scala for user questions and gitter.im/scala/contributors for compiler development.
This channel is now CLOSED. Please use gitter.im/scala/scala for user questions and gitter.im/scala/contributors for compiler development.
This channel is now CLOSED. Please use gitter.im/scala/scala for user questions and gitter.im/scala/contributors for compiler development.