List[(Double, Double)]

53 views
Skip to first unread message

Meeraj Kunnumpurath

unread,
Feb 11, 2017, 11:54:54 AM2/11/17
to scala-user
Hello,

The following two lines seem to be killing the compiler

val x = List((1.0, 2.0))
x.map { case(x, y) => x + y }

However, the below seems to be working

List((1.0, 2.0)).map { case(x, y) => x + y }

Thank you

--
Meeraj Kunnumpurath

Roland Kuhn

unread,
Feb 11, 2017, 12:06:23 PM2/11/17
to Meeraj Kunnumpurath, scala-user
Killed how? And which version of which compiler?

Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_121).
Type in expressions for evaluation. Or try :help.

scala> val x = List((1.0, 2.0))
x: List[(Double, Double)] = List((1.0,2.0))

scala> x.map { case(x, y) => x + y }
res0: List[Double] = List(3.0)

(it would have surprised me a lot if this expression did not compile)

Regards,

Roland

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Meeraj Kunnumpurath

unread,
Feb 11, 2017, 12:17:24 PM2/11/17
to Roland Kuhn, scala-user
Thank you

Welcome to Scala version 2.11.5 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_20).

java.lang.AssertionError: assertion failed: List(value _1$mcD$sp, value _1$mcD$sp, value _1$mcD$sp)

at scala.reflect.internal.Symbols$Symbol.suchThat(Symbols.scala:1916)

at scala.tools.nsc.transform.SpecializeTypes$$anon$2.matchingSymbolInPrefix$1(SpecializeTypes.scala:1460)

.....

That entry seems to have slain the compiler.  Shall I replay

your session? I can re-run each line except the last one.


To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.




--
Meeraj Kunnumpurath
Director and Executive Principal
Service Symphony Ltd
00 44 7702 693597
00 971 50 409 0169
mee...@servicesymphony.com

Meeraj Kunnumpurath

unread,
Feb 11, 2017, 12:21:16 PM2/11/17
to Roland Kuhn, scala-user
Updated to 2.11.7 and runs okay.

Thank you
Meeraj

Roland Kuhn

unread,
Feb 11, 2017, 12:21:38 PM2/11/17
to Meeraj Kunnumpurath, scala-user
I don’t have 2.11.5 handy, but 2.11.2 works just fine for me.

Your JDK version is very much outdated, though.

Regards,

Roland

To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.

Meeraj Kunnumpurath

unread,
Feb 11, 2017, 1:29:15 PM2/11/17
to Roland Kuhn, scala-user
Thanks.

I noticed the JDK version, it is not a machine I normally use for dev.

Thank you

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages