Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 08:57
    s5bug commented #1286
  • 08:10
    julienrf commented #1286
  • 07:49
    s5bug commented #1286
  • 07:48
    s5bug opened #1286
  • 07:45
    julienrf commented #1285
  • 07:40
    julienrf commented #2205
  • 07:40
    julienrf commented #2205
  • 07:39
    s5bug commented #1285
  • 07:38
    julienrf commented #1285
  • 05:38
    bishabosha commented #9791
  • 05:17
    SethTisue commented #1499
  • 05:17

    SethTisue on 2.13.x

    advance ip4s, same sbt-spiewak … (compare)

  • 04:43
    timothyklim commented #9791
  • 04:40
    SethTisue commented #1499
  • 04:35
    SethTisue edited #795
  • 04:34
    SethTisue edited #795
  • 04:34
    SethTisue milestoned #9767
  • 04:34
    SethTisue demilestoned #9767
  • 04:34
    SethTisue milestoned #9786
  • 04:34
    SethTisue demilestoned #9786
Rob Norris
@tpolecat
You can make Open and Closed extend some supertrait and parameterized it as [A <: DoorState] if you like but it probably doesn't matter.
Upper bounds are rarely necessary.
Guillaume Martres
@smarter
@tpolecat conversation on this issue was moved to scala/scala
Rob Norris
@tpolecat
ah
Guillaume Martres
@smarter
(spoiler: it's fixed in dotty)
cmhteixeira
@cmhteixeira
@tpolecat As smarter says, its on scala/scala. Thanks. The question was also more with the objective of understanding why that was happening. I was already aware of the implicit alternative. I appreciate it though!
For reference, we ended up opening this ticket: scala/bug#12413
Rob Norris
@tpolecat
ok
Swoorup Joshi
@Swoorup
this should ideally fail type check isn’t it?
import scala.language.implicitConversions

type Timeframe = "1m" | "2m" | "1H"
type TimeframeN = 1 | 2 | 60

def manualConvertToN(tf: Timeframe): TimeframeN = tf match
  case "1m" => 1
  case "2m" => 2
  case "1H" => 60
  case "4H" => 60 // incorrect
Rob Norris
@tpolecat
Seems like a bug to me. Looks like it's checking that the LHS is a string (case true => ... fails) but it needs to check that it's a Timeframe.
Swoorup Joshi
@Swoorup
yep logged a bug: lampepfl/dotty#12805
seems to prematurly widen
sinanspd
@sinanspd
hmm
aren't Enums a better use for this ?
like i am actually not sure what the expected behavior here should be
You are creating a union type with concrete values, no?
sinanspd
@sinanspd
nvm it seems like this is in fact expected to work
Swoorup Joshi
@Swoorup
they are good near the boundaries interacting with other languages, or doing things like
def acceptFontSize(fontSize: 9 | 10 | “11rem”) = ???
widening/or unwidening are purely a compile time construct
Bjorn Regnell
@bjornregnell
I have problems translating "universal apply methods" and "creator applicators" to Swedish in my lectures. I'm considering instead to use the translation of "optional new" (in Swenglish this becomes "valfri new", which to me seems less intimidating to a beginner). Does anybody know why it is called "universal apply methods" (which to me seems kind of a bold name as the universe consists of more than classes ;)) and why the name "creator applicators" was dropped (if it was?) and if "optional new" is ok as a name for the language feature of a generated apply calling a/the constructor also for plain classes not just case classes?
som-snytt
@som-snytt
"auto-application of constructor proxy object"
scala> class C
// defined class C

scala> extension (c: C.type) def f = 42
1 |extension (c: C.type) def f = 42
  |              ^
  |              constructor proxy object C cannot be used as a value
Bjorn Regnell
@bjornregnell

"auto-application of constructor proxy object"

Wow that's a mouthful :emoji-with-mouthful:

Bjorn Regnell
@bjornregnell
The English "proxy" translates to Swedish as "ombud", which is a conceptual part of one of the few Swedish loanwords we have exported to English, namely "ombudsman". We also have exported "smorgasbord", which perhaps could be used as a generic collective name for all goodies in Scala 3. Or perhaps "smorgasbord" is what we get when we press TAB in the Scala 3 REPL. :)
som-snytt
@som-snytt
It is true that the traditional smorgasbord consisted entirely of s'mores?
Curious if anyone is going to use the discord. I wished to note that seeing lrytz and smarter together on dotty is like a crossover comic, League of Assassins and you're like, Oh cool, I didn't know lrytz was also an Assassin.
Bjorn Regnell
@bjornregnell
Maybe the vikings brought https://en.wikipedia.org/wiki/S%27more from somewhere but I doubt it. A traditional smorgasbord is like spanish tapas but with more focus on herring and salmon and way less spicy but way more salty (so the food can be saved until the cold winter in pre-fridge-times).
Jasper Moeys
@Jasper-M
@bjornregnell IIRC the feature started as actually rewriting Foo() to new Foo() if no Foo.apply() exists. But it was redesigned to instead generate a fictitious Foo object and apply() method on demand.
Jasper Moeys
@Jasper-M
(that should explain why the name changed to "universal apply methods" or "auto-application of constructor proxy object")
Bjorn Regnell
@bjornregnell
@Jasper-M Thanks! Good to know. And the example above in REPL from @som-snytt is telling and I might include something similar as an exercise in the week of "classes" to get students acquainted with the compiler lingo here. (Course progression per-week main focus: functions, programs, objects, classes, patterns, ...). Still unsure how to translate "auto-application of constructor proxy object". Your words "fictitious" and "on demand" is inspirational... :)
Bjorn Regnell
@bjornregnell
With the instructions for cs download here https://www.scala-lang.org/download/scala3.html you get scala3-compiler and scala3-repl on your path but no scala3 runner to run your compiled programs. So how to run your programs compiled with the cs-installed scala3-compiler? Seems like the docs on the scala-lang download page could be improved... (I asked this in the coursier gitter as well but there seems to be little activity there - sorry for double posting. :blush: )
Jasper Moeys
@Jasper-M
@bjornregnell Don't know if this is coincidence or not but I just saw this issue in the gitter sidebar scala/scala-lang#1250
Bjorn Regnell
@bjornregnell
Aha! It is a bug... And a very confusion omission that is more or less a showstopper for cs in my course where we compile and run in terminal before starting with sbt. And there is no .msi for scala3 so how to install on windows without manual fiddeling with unpacking zip and environment variable path etc etc???
Bjorn Regnell
@bjornregnell
Eric K Richardson
@ekrich
Good on-boarding is important. Certainly the Development experience has improved so much with Metals/Bloop/Editor.
martingd
@martingd

@SethTisue My pull request scala/scala-parser-combinators#402 fails test for Scala.js. How do I run these tests locally before opening a PR? I tried simply running sbt test but that fails with

[error] (parserCombinatorsJS / Test / loadedTestFrameworks) org.scalajs.testing.common.RPCCore$ClosedException: org.scalajs.testing.adapter.JSEnvRPC$RunTerminatedException

Is there a guide to setting this up correctly (macOS) so I can run also the Scala.js tests locally?

Sébastien Doeraene
@sjrd
@martingd You probably need to install Node.js. Make sure that running node -v in the command line works.
martingd
@martingd
@sjrd That worked. Thanks. Now, all tests run and they pass – including the test that fails on Travis for my pull request.
Sébastien Doeraene
@sjrd
Looking at https://github.com/scala/scala-parser-combinators/pull/402/checks?check_run_id=2846684914, it doesn't seem to me that the errors are Scala.js-related, but rather Scala version-related.
They fail for 2.11 and 2.12 because of methods that were introduced in the 2.13 collections library.
equally on the JVM and JS
(there's also a MiMa error in 2.13.6)
martingd
@martingd
@sjrd Yes, you are absolutely right (which I also realised) and I am fixing them using the += and ++= forms for addOne and addAll on ListBuffer respectively.
The test failure about binary incompatibilty I am also fixing – changing a new method on StdLexical from protected to private as it is tied to the concrete definition of def token in that class anyway.
Seth Tisue
@SethTisue
@bjornregnell thanks for all the really helpful bug reports and questions, btw
Bjorn Regnell
@bjornregnell
thanks!! happy to help :) :heart:
som-snytt
@som-snytt
:+1:
Princess | April
@NthPortal
This message was deleted
Bjorn Regnell
@bjornregnell
hi contributors and community leaders; it is currently a bit confusing where to post questions on what and where to pre-discuss potential issues and where to post actual issues, esp. since there are more than one place on github: scala and lampepfl, and several forums. It is also not obvious to me who are official leaders of what. The community page https://www.scala-lang.org/community/ could perhaps make this clearer. I suspect this is related to already on-going work on consolidating dotty into scala and some new working-structures and responsibilities etc, and I fully appreciate that in open source it takes some effort now and then to restructure things and re-think as we grow and mature. @SethTisue @smarter @tpolecat This is perhaps better discussed in a new Discourse thread (?), but wanted to check with you first here and maybe this is already in the pipeline. (PS1. Also, this is perhaps not a super-big deal; we can live with as-is and help each other to dispatch, but I think esp. for newcomers to our community we should be able to provide an easier explanation on the community page of what-goes-where and also on who-is-leading-what.) (PS2. Having discussed and posted some issues recently, I just want to say thanks to all here for all you super-friendly and awesome help; the Scala community is great :heart: ) )
Guillaume Martres
@smarter
I think it's something the scala center should take responsability for and it's probably best discussed in contributors.scala-lang.org yeah