On Mon, Feb 8, 2010 at 1:33 PM, Jeppe Nejsum Madsen <[email protected]>wrote:
> David Pollak <[email protected]> writes: > > > On Mon, Feb 8, 2010 at 12:54 PM, Jeppe Nejsum Madsen <[email protected] > >wrote: > > > >> Hi, > >> > >> How can I create a List of MappedField from different Mappers: > >> > >> I want to create a function like this: > >> > >> def requiredFields(mfs: List[MappedField[_,Any]]) > >> > > > > Does this not work? > > Well, the definition works, but > > >> and call it like this > >> > >> requiredFields(List(Table1.field1, Table2.field2)) > > The call generated a huge type error. But changing the definition to > > def requiredFields(mfs: List[MappedField[_,_]]) > > seems to work. It looks like, for reasons that are not entirely clear to > me that the compiler tries to apply the implicit mapToType in this case: > > val mf: MappedField[_,Any] = Table1.column1 > > and then complains: > > [INFO] found : Int > [INFO] required: net.liftweb.mapper.MappedField[_, Any] > Hmmmm.... it might also be that the second type parameter is invariant so Any will not match Int. Glad _ is working for you. > > /Jeppe > > -- > You received this message because you are subscribed to the Google Groups > "Lift" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<liftweb%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/liftweb?hl=en. > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
