Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Sep 17 16:31
    som-snytt commented #8039
  • Sep 17 11:59

    lrytz on 2.12.x

    Avoid `case _: C[_]#K` type tes… Merge pull request #9762 from l… (compare)

  • Sep 17 11:59
    lrytz closed #9762
  • Sep 17 11:44
    tgodzik commented #9761
  • Sep 17 09:18
    lrytz synchronize #9762
  • Sep 17 09:06
    scala-jenkins milestoned #9762
  • Sep 17 09:06
    lrytz review_requested #9762
  • Sep 17 09:06
    lrytz opened #9762
  • Sep 17 08:36
    lrytz commented #12463
  • Sep 17 08:33
    joroKr21 commented #12463
  • Sep 17 08:27
    lrytz commented #12463
  • Sep 17 08:27
    lrytz commented #12463
  • Sep 17 07:48
    nwk37011 synchronize #9752
  • Sep 17 07:39
    nwk37011 synchronize #9752
  • Sep 17 07:33

    lrytz on 2.12.x

    Fix range position end for infi… Merge pull request #9761 from l… (compare)

  • Sep 17 07:33
    lrytz closed #9761
  • Sep 17 07:33
    nwk37011 synchronize #9752
  • Sep 17 07:33
    lrytz commented #9761
  • Sep 17 05:58
    nwk37011 synchronize #9752
  • Sep 17 00:10
    som-snytt commented #12463
Guillaume Martres
@smarter
that would mean that value classes would have different semantics than regular classes, which would be surprising
Dale Wijnand
@dwijnand
actually.. would it be impossible for it to be true?
wouldn't .isInstanceOf[NonEmptyString] erase to .isInstanceOf[String]?
I'm confused, Guilliaume :)
Guillaume Martres
@smarter
no, it doesn't
again, we want value classes to behave like regular classes, otherwise your code will break in weird ways when you switch a class from one to the other
Dale Wijnand
@dwijnand
what does (x: NonEmptyString).isInstanceOf[NonEmptyString] erase to?
Guillaume Martres
@smarter
in that case the compiler should be smart and erase it to true ;)
Dale Wijnand
@dwijnand
oh.. right.. :)
Guillaume Martres
@smarter
If you have a value of type Any and you pattern match on it, you want to be able to distinguish a NonEmptyString from a String, and not treat them as the exact same thing
this is only possible if you always box value classes when they appear in generic positions
Dale Wijnand
@dwijnand
uh type matching..
Guillaume Martres
@smarter
same issue if you pattern match on case classes, because it's implemented using isInstanceOf/asInstanceOf
Dale Wijnand
@dwijnand
ban type matching :)
Guillaume Martres
@smarter
There's actually a discussion of this and an alternative hypothetical mechanism of "incompatible type aliases" in my master thesis on value classes, section 4.5: http://guillaume.martres.me/master_thesis.pdf
Dale Wijnand
@dwijnand
I know that thesis :)
Guillaume Martres
@smarter
As usual, my conclusion is "let's wait for value types on the JVM instead of adding more crazy workarounds in the language and the implementation"
Dale Wijnand
@dwijnand
right..
Miles Sabin
@milessabin
TLS 2.12.1 staged on sonatype ... please kick the tyres before release: https://github.com/typelevel/scala/issues/129#issuecomment-276390483.
Ghost
@ghost~54f4b69115522ed4b3dcb16d
So happy that I can cherry-pick my unmerged PRs without conflicts! Maybe I should have tweeted that instead of geeting. It's just quality-of-life stuff, not like it's about correctness or anything.
@milessabin Do you mean tires like wheels? and not tyre as in Pericles, Prince of Tyre? I could kick Pericles, if it would help.
Miles Sabin
@milessabin
Be my guest.
Ghost
@ghost~54f4b69115522ed4b3dcb16d
That Pericles really gets my goat.
Otto Chrons
@ochrons
Did you mean goatee?
Liara
@kiritsuku
@lrytz I could need your help about the new backend. In scala-ide we depended on TypeKind in our 2.11 version. While migrating to a 2.12 version it had to be replaced by BType. Please see this commit: sschaef/scala-ide@2cd885e It introduces a call to typeToBType, which unfortunately throws a NPE at runtime.
The stack trace is something along:
java.lang.NullPointerException
    at scala.tools.nsc.backend.jvm.CoreBTypesProxy.primitiveTypeToBType(CoreBTypes.scala:361)
    at scala.tools.nsc.backend.jvm.BTypesFromSymbols.primitiveOrClassToBType$1(BTypesFromSymbols.scala:177)
    at scala.tools.nsc.backend.jvm.BTypesFromSymbols.typeToBType(BTypesFromSymbols.scala:192)
    at org.scalaide.core.internal.jdt.model.ScalaJavaMapper.javaDescriptor(ScalaJavaMapper.scala:246)
    at org.scalaide.core.internal.jdt.model.ScalaJavaMapper.javaDescriptor$(ScalaJavaMapper.scala:245)
    at org.scalaide.core.internal.compiler.ScalaPresentationCompiler.javaDescriptor(ScalaPresentationCompiler.scala:53)
    at org.scalaide.core.structurebuilder.ScalaJavaMapperTest.$anonfun$withTargetTree$2(ScalaJavaMapperTest.scala:81)
    at scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:26)
    at scala.tools.nsc.interactive.Global.$anonfun$pollForWork$1(Global.scala:444)
    at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:418)
    at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:22)
In the REPL the following code works fine:
import genBCode.bTypes._
> typeToBType(typeOf[Int])
res0: $r.intp.global.genBCode.bTypes.BType = I
But in the IDE codebase it also throws an NPE
Do you have any ideas about things we need to do in order to initialize the backend correctly?
Liara
@kiritsuku
I found out that I can fix the issue by doing a genBCode.bTypes.initializeCoreBTypes() before I access the btypes stuff
@lrytz Is this the right way to fix this issue or could something else be wrong?
Seth Tisue
@SethTisue
    val nonzero = 17     // rounding down from 17.3
@som-snytt 😂
Rory Graves
@rorygraves
@retronym The intellij SAMPLE file that you commited recently is in a broken state: https://github.com/scala/scala/blob/2.12.x/src/intellij/scala.ipr.SAMPLE#L244
Dale Wijnand
@dwijnand
@rorygraves scala/scala#5668
Rory Graves
@rorygraves
Missed that - had just created - scala/scala#5670
will close it
Ghost
@ghost~54f4b69115522ed4b3dcb16d
@SethTisue You were maybe expecting a value closer to 42.
Seth Tisue
@SethTisue
as @travisbrown points out on Twitter (https://twitter.com/travisbrown/status/826931357288914945), this abandoned PR, fixing a Scaladoc regression in 2.12, could use some love. anyone want to try to get it over the finish line...? scala/scala#5461
Ghost
@ghost~54f4b69115522ed4b3dcb16d
Maybe think of it as "mutual rescue", as in this video. Working on random quality of life issues also improves the quality of your life!
Jorge
@jvican
Have you tried with this?
-Ystatistics:<_,phase,-phase> Print compiler statistics for specific phases:_' for all, -Ystatistics:help' to list choices.
Jorge
@jvican
Interesting, I think there's some way to enable it with a java property.
I’m also thinking there must be a way, but I’m not finding it :)
Jorge
@jvican
I've literally grepped all the Scala compiler sources without any luck.
It's weird that -Ystatistics:typer only prints that.