Questions tagged [scala-2]

4 questions
3
votes
0 answers

illegal cyclic reference involving object scala and case class

Why do I get an error saying illegal cyclic reference? I thought objects in scala are like singleton and act as a container and cannot be instantiated. Why it is cyclic? How to fix this error without moving case class Baz out of object Bar? trait…
Node.JS
  • 1,042
  • 6
  • 44
  • 114
0
votes
1 answer

S3.getObject is truncating file contents in alpakka 4.0.0

I have a block of code like this: def downloadFilesSource(bucketName: String, primaryKey: String)( implicit ec: ExecutionContext ): Source[(Source[ByteString, NotUsed], String), NotUsed] = S3.listBucket(bucketName, prefix =…
user3468054
  • 610
  • 4
  • 11
0
votes
1 answer

In Scala 2, what are possible ways to write a shortcut of a partial function without triggering unchecked warning?

This is a follow-up question of: In Scala 3: Why runtime pattern matching can't work reliably on duck type using JVM reflection? I'm trying to create a pattern matching implementation in Scala that is more resilient to type erasure. It should still…
tribbloid
  • 4,026
  • 14
  • 64
  • 103
0
votes
1 answer

Execute splice() for varargs in macro method in Scala 2.13

I want to execute splice() for each argument of my varargs: import scala.reflect.macros.blackbox object LoggerMacro { def log(context: blackbox.Context) (message: context.Expr[String], arguments: context.Expr[Any]*) :…
Martin
  • 598
  • 1
  • 4
  • 27