How to pass by-name repeated parameters in Scala?
The following code fails to work:
scala> def foo(s: (=> String)*) = {
<console>:1: error: no by-name parameter type allowed here
def foo(s: (=> String)*) = {
^
Is there any other way I could pass a variable number of by name parameters to the method?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…