Home > OS >  scala 2.13: type IndexedSeq takes type parameters
scala 2.13: type IndexedSeq takes type parameters

Time:01-27

I have the following snippet which works fine on Scala 2.12 but does not compile on Scala 2.13.

import scala.util.Random
object Hello {
  def main(args: Array[String]) = {
    val random    = new Random()
    random.shuffle[Int, IndexedSeq](2 to 100).toArray
  }
}

The error is:

trait IndexedSeq takes type parameters

I have no idea on how to fix it. Thank you!

CodePudding user response:

You can add required type parameter:

random.shuffle[Int, IndexedSeq[Int]](2 to 100).toArray
  •  Tags:  
  • Related