Reflecting on Option(al) primitives

14 views
Skip to first unread message

David Whittaker

unread,
Apr 19, 2011, 12:46:20 PM4/19/11
to liftweb
Does any part of Lift use reflection to get the ParameterizedType of an Option?  This used to be possible in Scala but in 2.9 generic primitive type signatures are no longer available.  Option[scala.Int] for example used to be visible as Option[java.lang.Integer] but now it's just Option[java.lang.Object].  Just wanted to give you all a heads up, I know this affects some other JSON frameworks in particular.

Joni Freeman

unread,
Apr 19, 2011, 4:22:23 PM4/19/11
to lif...@googlegroups.com
Hi,

Lift JSON's extraction and serialization feature uses
ParameterizedTypes. It looks types like Option, List, Set, Map etc. no
longer work with primitives in 2.9. We need to investigate potential
solutions if this issue can't be fixed in the compiler.

Cheers Joni

> --
> 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
> +unsub...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.


David Whittaker

unread,
Apr 19, 2011, 4:27:14 PM4/19/11
to lif...@googlegroups.com
I was afraid that might be the case.  If you haven't seen it, you might want to check this thread for a little background on why the change was made: https://groups.google.com/forum/#!topic/scala-user/9B5Q2yupQ_E.  It seems that the generic sig with the primitive type info is still available in the byte code, it just can't be gotten at via java reflection.  I'm going to look into using asm to pull it out for Squeryl, I'll let you know if I have any luck.

To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages