它“splat”1序列。
查看构造函数签名
new Elem(prefix: String, label: String, attributes: MetaData, scope: NamespaceBinding,
child: Node*)
它被称为
new Elem(prefix, label, attributes, scope,
child1, child2, ... childN)
但是这里只有一个序列,而不是child1、child2等,所以这允许结果序列用作构造函数的输入。
这在SLS中没有一个可爱的名字,但这里是细节。重要的是,它改变了Scala使用重复参数将参数绑定到方法的方式(如上面的Node*所示)。
_*类型注释在SLS的“4.6.2重复参数”中包含。
The last value parameter of a parameter section may be suffixed by “*”, e.g. (..., x:T ). The type of such a repeated parameter inside the method is then
the sequence type scala.Seq[T]. Methods with repeated parameters T * take
a variable number of arguments of type T . That is, if a method m with type
(p1 : T1, . . . , pn : Tn,ps : S)U is applied to arguments (e1, . . . , ek) where k >= n, then
m is taken in that application to have type (p1 : T1, . . . , pn : Tn,ps : S, . . . , ps0S)U,
with k ¡ n occurrences of type S where any parameter names beyond ps are
fresh. The only exception to this rule is if the last argument is marked to be
a sequence argument via a _ type annotation. If m above is applied to arguments (e1, . . . , en,e0 : _), then the type of m in that application is taken to be
(p1 : T1, . . . , pn : Tn,ps :scala.Seq[S])**