Error while checking frozen types

29 views
Skip to first unread message

José Guilherme Vanz

unread,
May 20, 2015, 8:10:37 AM5/20/15
to java-dri...@lists.datastax.com
Hi!

I'm developing a scala application using the java driver. In runtime an exception is thrown.
The source code line with problem and the stacktrace can be view here:
https://gist.github.com/jvanz/d5b06eda316eab60348c

Have you ever seen some similiar problem in a scala application? What's my mistake?

Thank you

Olivier Michallat

unread,
May 20, 2015, 9:35:52 AM5/20/15
to java-dri...@lists.datastax.com
Hi,

The type checker resolves latitude as type Any because of the null. In the Java world this resolves to Object, the driver doesn't know how to map that. I think you need to specify the type explicitly.

scala> var foo = Some(1.0) match { case Some(d) => d case _ => null }
foo: Any = 1.0

scala> var foo:java.lang.Double = Some(1.0) match { case Some(d) => d case _ => null }
foo: Double = 1.0


--

Olivier Michallat

Driver & tools engineer, DataStax


To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

Reply all
Reply to author
Forward
0 new messages