Peter Robinett <pe...@bubblefoundry.com> writes: > Hi all, I'm getting the following error and I think I'm missing > something very simple: > error: type mismatch; > found : List[net.liftweb.http.js.JsExp] > required: net.liftweb.http.js.JsExp > JsonResponse(JsObj("results" -> JsArray(packets.map(_.asJs)))) > > I'm trying to transform packets, a List[mymodels.Packet], into a > simple object to be sent in a JsonResponse. As I understand it, > JsArray has a contructor that takes a List[JsExp] but the compile > error suggests that it doesn't. Is this constructor only in SNAPSHOT, > not 1.1-M5? In case it's relevant, here are my relevant package > imports: > import _root_.net.liftweb.http.js._ > import JsCmds._ > import JE._ > > I'm using Lift 1.1-M5 and Scala 2.7.5. Any help is appreciated. > Thanks!
I've run into this as well. It seems the alternative constructor on the case class is not being considered by the compiler. Don't know if this is WAD, but you can workaround by using the varargs constructor: JsonResponse(JsObj("results" -> JsArray(packets.map(_.asJs):_*))) /Jeppe --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---