- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Need Help Understanding & Correcting "missing parameter type for expanded function"
Mon, 2009-03-23, 15:08
Hi,
I'm trying to understand and resolve these errors:
/dar/rho/src/rho/alg/Traversals.scala
Error:Error:line (324)error: missing parameter type for expanded function
((x$12) => ExpressionCursor(expr, next.node.pos.ahead(), x$12, next.node.pol)) _, next.node.pol)))
The code is:
traversal ++ connected.map(TraversalAction(ahead, ExpressionCursor(expr, next.node.pos.ahead(), _, next.node.pol)))
A similar fragment:
traversal ++ next.at.asInstanceOf[FunctionTerm].args.map(ExpressionCursor(expr, next.pos.ahead(), _, next.pol))
Does not prodduce this error.
TraversalAction and ExpressionCursor are a case-class constructors.
I gather the problem has to do with the anonymous function parameter
being nested inside the second constructor the erroneous case, but
don't know how to resolve it.
Randall Schulz
Mon, 2009-03-23, 15:57
#2
Re: Need Help Understanding & Correcting "missing parameter typ
On Monday March 23 2009, Randall R Schulz wrote:
> Hi,
>
> I'm trying to understand and resolve these errors:
>
> /dar/rho/src/rho/alg/Traversals.scala
> Error:Error:line (324)error: missing parameter type for expanded function
> ((x$12) => ExpressionCursor(expr, next.node.pos.ahead(), x$12, next.node.pol)) _, next.node.pol)))
>
>
> The code is:
>
> traversal ++ connected.map(TraversalAction(ahead, ExpressionCursor(expr, next.node.pos.ahead(), _, next.node.pol)))
>
> ...
>
> TraversalAction and ExpressionCursor are a case-class constructors.
>
> I gather the problem has to do with the anonymous function parameter
> being nested inside the second constructor the erroneous case, but
> don't know how to resolve it.
On a hunch, I changed the code thusly:
traversal ++ connected.map(arg => TraversalAction(ahead, ExpressionCursor(expr, next.node.pos.ahead(), arg, next.node.pol)))
And it compiled. What did I do?
Randall Schulz
Luc
On Mon, Mar 23, 2009 at 3:08 PM, Randall R Schulz <rschulz@sonic.net> wrote:
--
__~O
-\ <,
(*)/ (*)
reality goes far beyond imagination