I was surprised with this compiler error message.
Is this a real limitation, or is it simply a question of using the correct syntax?
no by-name parameter type allowed here
The error message appears at the function definition site, not the function call-site.
I have a function defined like this.
def findSimplifier(simplifiers:List[(=> Type)]):Type = {
simplifiers match {
case Nil => this
case s::ss =>
val t2 = s
if ( this == t2)
findSimplifier(ss)
else
t2
}
}
And the call-site looks like this:
override def canonicalizeOnce: Type = {
findSimplifier(List[(=> Type)](
{
if (U.contains(EmptyType))
EmptyType
else
this
},
{
IntersectionType.apply(U.distinct)
}
))
}