Scala中的泛型类型

我最近开始学习Scala。而且我不明白为什么这段代码无法正常工作。有谁能够帮助我?

import scala.collection.mutable
import scala.collection.mutable.Map

class Bijection[T] (val v: Set[T]) {
  private var addition = 0
  private var reversed = false

  def add(i: Int)(implicit ev: T <:< Int) = {
    addition += i
  }

  def reverse(implicit ev: T <:< String) = {
    reversed = !reversed
  }
}

object Bijection {
  def apply(s: Set[String])(implicit ignore: String): Bijection[String] = {
    println("Hello")
    new Bijection(s)
  }
}

object Main {
  def main(args: Array[String]): Unit = {
    var x = new Bijection[String](Set[String]("fd", "fasf"))
  }
}

此代码应打印“ Hello”

评论