Questions tagged [scala-2.13]

Version 2.13 of the Scala programming language. Use for questions particularly addressing features of this version of Scala.

Scala 2.13 brings improvements in

  • compiler performance
  • simplifying the collections
  • modularizing the standard library
  • user-friendliness
100 questions
1
vote
1 answer

How to get the name of a class as a string literal at compile time using shapeless?

This is a follow-up question of: How to get the name of a case class field as a string/symbol at compile time using shapeless? Assuming that I want to write a recursive converter that can convert a product type: case class Prod ( a: Int, b:…
tribbloid
  • 4,026
  • 14
  • 64
  • 103
1
vote
1 answer

In scala 2.13, why is it sometimes impossible to summon type class explicitly? - Part 2

This is a follow up question of In scala 2.13, why is it sometimes impossible to summon type class explicitly?: The following code can compile properly: import shapeless._ import record._ import syntax.singleton._ val book = ("author"…
tribbloid
  • 4,026
  • 14
  • 64
  • 103
1
vote
1 answer

view bounds are deprecated; use an implicit parameter instead

I recently upgraded to Scala 2.13, and now am being warned about a deprecation. My function looks like so: implicit def convertGeneralResult[A <% ToResponseMarshallable, B <% ToResponseMarshallable](r: Either[A, B]) = …
ThaDon
  • 7,826
  • 9
  • 52
  • 84
1
vote
2 answers

scala 2.13 auto implicit resolution error

I am facing this weird problem related to scala implicit resolution Here is the code snippet import scala.collection.Factory import scala.collection.immutable.Seq sealed trait A sealed trait B case class BImpl() extends B case class AImpl()…
Divyanshu
  • 290
  • 2
  • 9
1
vote
1 answer

Scala cross compiling literal types

Is there a way to cross compile literal types to Scala 2.12? Let's say def foo[S <: String](implicit V: ValueOf[S]): String = V.value println(foo["bar"]) Shapeless can encode literal types with shapeless.Witness, so it should be possible to shim…
gogstad
  • 3,607
  • 1
  • 29
  • 32
1
vote
0 answers

Getting the following error : java.lang.NoSuchMethodError: scala.Predef$.wrapRefArray([Ljava/lang/Object;)Lscala/collection/mutable/WrappedArray;

Getting the following error : java.lang.NoSuchMethodError:scala.Predef$.wrapRefArray([Ljava/lang/Object;)Lscala/collection/mutable/WrappedArray; I'm not sure about the nature of the error but I believe it has to do something after it tried to…
1
vote
1 answer

Embedding scala 2.13.x REPL

For Scala 2.12.x one could use scala.tools.nsc.interpreter.ILoop to embed the Scala REPL. With Scala 2.13.x scala.tools.nsc.interpreter.ILoop has been removed. How could one embed the Scala 2.13.x REPL?
collymy
  • 77
  • 7
1
vote
1 answer

Generate companion object for case class with methods (field = method)

Generate companion object for case class with scala-macros some code example that i tried, it works i can get list of tuple (name -> type) but how to generate the object in the same scope? import c.universe._ val tpe = weakTypeOf[T] val…
Code_VM
  • 23
  • 1
  • 4
1
vote
1 answer

Scala 2.13 (im)mutable .map with 'Nothing" reference

I'm upgrading a software scala based from scala 2.12 to scala 2.13. Some blocks of code was broken and fixing them I found a wierd behavior in an already existing code. @Edit Below we have an explanation of a use case of this problem. The problem in…
Fernando Rezk
  • 314
  • 1
  • 18
1
vote
1 answer

How to fix the unresolved dependencies for Anorm in scala version 2.13

I would like to import anorm dependencies on to my scala play frame work project but it doesn't support on my current scala version. What should I do? libraryDependencies += "com.typesafe.play" %% "anorm" % "2.3.9" Error…
koko ka
  • 107
  • 4
  • 17
1
vote
2 answers

How to use literal type in Scala 2.13

I'm trying Literal Types from Scala 2.13 and I encounter the following error : scala> def double[A <: Singleton] = valueOf[A] ^ error: No singleton value available for A. Could you explain why ?
Yann Moisan
  • 8,161
  • 8
  • 47
  • 91
0
votes
0 answers

scala 2.13 : unable to load a Suite class that was discovered in the runpath Cause: java.lang.NoClassDefFoundError: org/json4s/JsonAST$JValue

I am migrating a project from scala 2.12 to 2.13 and I manage to make everything to compile. Buy when I run my tests I get an error com.alexm.spark.ml.bojo.StringValueImputerTest *** ABORTED *** java.lang.RuntimeException: Unable to load a Suite…
0
votes
1 answer

Scala 2.13 No implicit view available from java.util.Map[String,Double] => scala.collection.IterableOnce[B]

I migrate some scala code from 2.12 to 2.13 and I have the following code def getMetrics(): java.util.Map[String, Double] ={ transformers.map{ case transformer => transformer match{ case t: EvaluationTransformFunction =>…
0
votes
2 answers

Scala 2.13 : wrong number of type parameters for method map

I am newbie to scala and I migrate some code from scala 2.12 to 13. I have the following code override def transformSchema(schema: StructType): StructType = { StructType(schema.fields ++ this.getOutputCols.map[StructField, Array[StructField]](…
0
votes
2 answers

spark mssql connector with scala 2.13 -java.lang.NoSuchMethodError: scala.collection.immutable.Map.$plus

I am using scala 2.13 , spark 3.3.0 and mssql latest spark connector that is "com.microsoft.azure" % "spark-mssql-connector_2.12" % "1.3.0-BETA" here I am inserting data into mssql df.write .format("com.microsoft.sqlserver.jdbc.spark") …
Shalaj
  • 579
  • 8
  • 19