title: Scala 3 Varargs apply method for case class
body: <p>I am practicing scala 3. I was trying to create a simple Matrix class with a simpler constructor than writing an array of arrays with values. So I wanted to use Seq of Varargs.</p>
  <pre><code>Matrix(Seq(1,2,3), Seq(1,2,3))
  </code></pre>
  <p>Instead of:</p>
  <pre><code>Matrix(Seq(Seq(1,2,3), Seq(1,2,3)))
  </code></pre>
  <pre><code>object Matrix {
  
    def apply[T: ClassTag](arr: Seq[T]*): Option[Matrix[T]] = {
      val width: Int = arr.head.length
      if(arr.forall(_.length == width))
        Some(new Matrix(arr))
      else
        None
    }
  
  }
  
  case class Matrix[T: ClassTag] private(arr: Seq[Seq[T]])
  </code></pre>
  <p>This example code compiles in Scala 2, but in Scala 3 I get the following error.</p>
  <pre><code>method apply in object Matrix is not a legal implementation of `apply` in object Matrix
    its type             [T]
    (arr: Seq[Seq[T]])
      (implicit evidence$2: reflect.ClassTag[T]): 
        Option[com.miloszjakubanis.grid.data.Matrix[T]]
    does not conform to  [T]
    (arr: Seq[Seq[T]])
      (implicit x$0: reflect.ClassTag[T]): 
        Option[com.miloszjakubanis.grid.data.Matrix[T]]
       &amp; com.miloszjakubanis.grid.data.Matrix[T]
  </code></pre>
  <p>Compiler will also stop complaining if I remove <code>case</code> keyword from my class (but what if I'd like to keep it)</p>