Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 12:52
    linteck edited #2212
  • 12:52
    linteck edited #2212
  • 12:51
    linteck edited #2212
  • 12:51
    linteck edited #2212
  • 12:50
    linteck edited #2212
  • 12:49
    linteck edited #2212
  • 12:48
    linteck opened #2212
  • 11:34
    bishabosha synchronize #9791
  • 10:24
    arbitrary-dev closed #1287
  • 10:24
    arbitrary-dev commented #1287
  • 09:54
    arbitrary-dev opened #1287
  • 08:30

    lrytz on 2.13.x

    Add -Vimplicits-max-modules opt… Only truncate qualified types w… Merge pull request #9767 from m… (compare)

  • 08:30
    lrytz closed #9767
  • 08:23
    tek commented #9767
  • 06:51
    lrytz commented #9791
  • 06:07
    Philippus closed #2210
  • 06:07
    Philippus commented #2210
  • 06:06

    Philippus on main

    Case Classes example with strin… Merge pull request #2211 from k… (compare)

  • 06:06
    Philippus closed #2211
  • 04:22

    SethTisue on 2.13.x

    fix Akka (#1500) (compare)

Rob Norris
@tpolecat
Getting the string representation for a type is a longstanding and super irritating problem in Scala and it has no general solution as far as I know. Many people have told me "oh that should be easy" but it's not.
OlegYch
@OlegYch
Swoorup Joshi
@Swoorup
@tpolecat that means I would probably have to use arrays along with tailrecursion
Graham Brown
@geronimus
Thanks @tpolecat and @OlegYch ! This solves my immediate problem and also makes for a lot of interesting reading.
Rob Norris
@tpolecat
I'm getting a NoSuchMethodError trying to call this Java method https://github.com/testcontainers/testcontainers-java/blob/8965712f239ae3c449cec579264af5e79265f314/core/src/main/java/org/testcontainers/images/builder/traits/ClasspathTrait.java#L13 from Scala 3. @smarter is there anything about this Java type that makes you suspicious?
It works fine when called from Scala 2.11/12/13
Luis Miguel Mejía Suárez
@BalmungSan
Maybe something related to the F-Bound?
shvahabi
@shvahabi:matrix.org
[m]

Is xml string interpolation implemented as a feature of Scala 3 ? If positive, how can I make

xml"""
         |<p>Hello World!</p>
         |""".stripMargin

compile? I always receive a value xml is not a member of StringContext error message.

Luis Miguel Mejía Suárez
@BalmungSan
AFAIK xml support is not part of the compiler anymore.
If such interpolator exists it should be part of some library, maybe this one: https://github.com/scala/scala-xml
1 reply
shvahabi
@shvahabi:matrix.org
[m]
is the sample code for xml interpolation at https://dotty.epfl.ch/docs/reference/dropped-features/xml.html compilable in anyway?
Luis Miguel Mejía Suárez
@BalmungSan
It seems the Scala 3 docs are still at RC1
Uhm, I hope the will update them soon.
Tom Grigg
@griggt
@BalmungSan 3.0.1-RC1, not 3.0.0-RC1
Luis Miguel Mejía Suárez
@BalmungSan
ups
But that import doesn't work on 3.0.0 so maybe it was just added?
Tom Grigg
@griggt
the docs for 3.0.0 are not online afaik
Luis Miguel Mejía Suárez
@BalmungSan
Ah it is another library @shvahabi:matrix.org https://github.com/lampepfl/xml-interpolator
Tom Grigg
@griggt
jinx
shvahabi
@shvahabi:matrix.org
[m]
Thanks @griggt and @BalmungSan it seems to be the right answer. But that library seems neither have a release nor being published to scaladex. How can I add it as a dependency? Any solution other than an unmanaged dependency in lib folder?
It also is not available under dotty here https://dotty.epfl.ch/api/index.html
Luis Miguel Mejía Suárez
@BalmungSan
@shvahabi:matrix.org lampepfl/xml-interpolator#17
1 reply
It seems that repo is just a PoC (that apparently was successful)
So the final results should be merged into scala-xml and published soon.
As of today, it seems there is not easy way of using it.
You may want to pop up in that issue and show interest in it being merged.
Felix Bruckmeier
@felixbr

Hi, I've noticed that getting the name of method parameters seems to have changed between 2.13.4 and 2.13.5.

When I have a method

def listCars(`airport-code`: String): Seq[String] = ???

and try to get the names via

classOf[RentalStation].getMethod("listCars", classOf[String]).getParameters.map(_.getName)

Previously it returned "airport-code" for the parameter and now it seems to return "airport$minuscode". My guess is the internal representation has changed and therefore the java reflection no longer works as expected. Is there any other way to solve this than a bandaid-solution using .replaceAll() ?

(This is not my code, so please don't explain to me that reflection is bad, I know that. I'm just trying to upgrade this very commonly used library)

Luis Miguel Mejía Suárez
@BalmungSan
Maybe using Scala reflection over Java one would provide better results?
(just a pointer, no idea how to do that, sorry)
Felix Bruckmeier
@felixbr
The end goal of my efforts is to make this library Scala 3 compatible. So using scala-reflect might indeed work but introducing it doesn't exactly help with the Scala 3 migration 🙂
Guillaume Martres
@smarter
The names had to be encoded because you can't store any random String as a parameter name
to get back the original names you'd have to decode them
Felix Bruckmeier
@felixbr
Is there a function to do that?
(it's in scala.reflect but it's actually part of scala-library)
Felix Bruckmeier
@felixbr
Thank you, this helps a lot :)
gitleet
@gitleet
does scala3 require a specific java version?
Rob Norris
@tpolecat
8+
gitleet
@gitleet
I have openjdk 14.02
Rob Norris
@tpolecat
I think it should work on any JVM >= 8
Luis Miguel Mejía Suárez
@BalmungSan
Are you getting some error?
gitleet
@gitleet
Why does the scala3 g8 template reference this scala version? https://github.com/scala/scala3.g8/blob/main/build.sbt#L4
2.12.13
Rob Norris
@tpolecat
That's for the g8 template project. The actual template code is down in https://github.com/scala/scala3.g8/tree/main/src/main/g8
gitleet
@gitleet
ah ok! Yes doing scalaVersion shows scala 3.0.0
Elvis Opoku Amoako
@Elvis020
any new things with scala3.0.0??
Rob Norris
@tpolecat
yes lots of new things
Elvis Opoku Amoako
@Elvis020
yaay..havenet had time to check to new stuff out yet, wil do very soon
Rob Norris
@tpolecat
http://dotty.epfl.ch/docs/reference/overview.html <- this section of the doc covers the changes