Dotty: how to use varargs

I am trying to bind varargs to a List. I have the following (redacted):

    final case class Schema(g: List[(Geometry | shape.Shape)]) extends Geometry
    def schema(gs: (Geometry | shape.Shape)*): Unit = Schema(gs: _*)

and I get this error:

[error] -- [E007] Type Mismatch Error: /home/user/IdeaProjects/snol/splotly/src/gg/Examples.scala:257:61 
[error] 257 |    def schema(gs: (Geometry | shape.Shape)*): Unit = Schema(gs: _*)
[error]     |                                                             ^^
[error]     |Found:    (gs : Seq[gg.Examples.Geom.Geometry | gg.Examples.shape.Shape] @Repeated)
[error]     |Required: List[gg.Examples.Geom.Geometry | gg.Examples.shape.Shape]
[error] one error found

I have looked at the documentation, but I must be missing something obvious.

Can anyone be so kind as to point me in the right direction?


I’m not familiar with dotty, however: Just as in Scala 2, varargs seem to map to Seq, while you more specifically require a List - thus: Schema(gs.toList)…?

@sangamon you gave me the answer. Seems to be the same as Scala 2 - by changing Schema's List to Seq solved it. Alternativelly, removing the : _* and using gs.toList also solves it.