1

I am using custom Predef with -Yno-predef flag. It is basically a copy of SlamData's one.

When I try to flatten nested immutable Seqs collections I receive error:

No implicit view available from my.Predef.Seq[String] => scala.collection.GenTraversableOnce[String].

If I put import scala.Predef._ it will compile again. I tried to investigate scala.Predef and scala package object but when I tried to copy TraversableOnce's, Traversable's or Seq's definitions it didn't help.

Do someone know which part of vanilla predef is responsible for generating this implicit?

Mateusz Kubuszok
  • 24,995
  • 4
  • 42
  • 64

2 Answers2

5

You are looking for Predef.$conforms.

A way to figure it out is to run scala -Xprint:typer -e 'Seq(Seq(1)).flatten' on the command line. It'll print the entire syntax tree, with all implicits resolved.

Dima
  • 39,570
  • 6
  • 44
  • 70
0

After some digging I've found out that what I was missing was:

type <:<[-From, +To] = scala.Predef.<:<[From, To]
implicit def $conforms[A]: A <:< A = scala.Predef.$conforms[A] 

Apparently it is required for implicit evidence used inside all those type class derivation inside companion objects.

Mateusz Kubuszok
  • 24,995
  • 4
  • 42
  • 64