Updated object Snippet apply() causing 'error: missing arguments for method'

47 views
Skip to first unread message

Harry-Anton Talvik

unread,
Aug 24, 2011, 10:52:25 AM8/24/11
to lif...@googlegroups.com
Hi,

My CI job exercising 2.4-SNAPSHOT with Scala 2.8.1 informed me tonight
that new apply() method in Snippet object [1] caused compilation error
with message like
[...] error: missing arguments for method list in trait CRUDOps;
[INFO] follow this method with `_' if you want to treat it as a
partially applied function
[INFO] Snippet("list", list) ::
[INFO] ^
(Using here Derek's CRUDOps trait [2] -- thank you, Derek, for creating that).

More verbosely, new apply() method, and the old one below that:
+ /**
+ * Build a Loc.Snippet instance out of a name and a
DispatchSnippet (or StatefulSnippet, LiftScreen or Wizard).
+ * The "render" method will be invoked on the Dispatch snippet
+ */
+ def apply(name: String, snippet: DispatchSnippet): Snippet =
+ new Snippet(name, ns => snippet.dispatch("render")(ns)) // Issue #919
+
+ /**
+ * Build a Loc.Snippet instance for a given name and a function.
Note that the function is call-by-name
+ * so that it will be created each time it's used. This is
useful for CSS Selector Transforms
+ */
def apply(name: String, func: => NodeSeq => NodeSeq): Snippet =
new Snippet(name, func)

list()-method looks like so:
def list (xhtml : NodeSeq) : NodeSeq = { ... }

And DispatchSnippet:
https://github.com/lift/framework/blob/1c861f6b3b1ac321823995111d163c178c42ddac/web/webkit/src/main/scala/net/liftweb/http/StatefulSnippet.scala#L165


What and where and how would be the right/best way to fix this error?


[1] https://github.com/lift/framework/commit/f40deb760caa982c18230dfa5c802a03bd03bae5
Is fix for: https://www.assembla.com/spaces/liftweb/tickets/919
[2] https://github.com/dchenbecker/LiftTicket/blob/master/src/main/scala/org/liftticket/liftticket/model/CRUDLike.scala

Thanks,
Harry-A

David Pollak

unread,
Aug 24, 2011, 10:59:19 AM8/24/11
to lif...@googlegroups.com

Try:

Snippet("list", list _)

This tells the compiler that list is a function.  It's not able to infer that with the overloaded apply() method name.
 

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net

David Pollak

unread,
Aug 24, 2011, 10:59:42 AM8/24/11
to lif...@googlegroups.com
BTW -- Huge thanks for doing CI against SNAPSHOT!!!!

On Wed, Aug 24, 2011 at 10:52 AM, Harry-Anton Talvik <harry...@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

Reply all
Reply to author
Forward
0 new messages