concise function literal as foreach argument
Hello list,
I'm having a strange type resolution error in a function literal.
Given this:
tracks\\"track" foreach { track => println(track\"name" text) }
where tracks is a NodeSeq, I can iterate over each "track" element and
dump its "name" text node. The literal syntax doesn't have a type
declaration, and so I figured this could be further reduced:
tracks\\"track" foreach { println(_\"name" text) }
However the compiler falls over with:
error: missing parameter type for expanded function ((x$1) =>
x$1.$bslash("name").text)
tracks\\"track" foreach { println(_\"name" text) }
That doesn't make sense, give that a) it knows the type of the
collection (inferred to NodeSeq) and b) the working example merely
names the variable, but doesn't declare its type. Am I missing
something here?
Sincerely,
Chris