ArrowAssoc / AnyVal question
Ryan Williams <[email protected]> Tue, 07 Mar 2017 16:52:05 +0000
| Newsgroups | gmane.comp.lang.scala |
|---|---|
| Message-ID | <CANeJXFN2_NTaMjGN6a5UXjcieGV=9CzANnvt6C_jk1vXUdvO0g@mail.gmail.com> |
--94eb2c03d95ea40840054a26d50d
Content-Type: text/plain; charset=UTF-8
My understanding of value-classes led me to believe that usages of the "->"
from ArrowAssoc
<https://github.com/scala/scala/blob/v2.12.1/src/library/scala/Predef.scala#L308>
would be compiled out and run as if Tuple2's had been instantiated directly.
However, when I feed this file to scalac (2.12.1):
// Test.scala
object Test {
val tuple = "aaa" -> "bbb"
}
I see instances of ArrowAssoc in the resulting bytecode.
Here's a gist
<https://gist.github.com/ryan-williams/20b96b78c3414e7292302a9e6f799e8a>
with the .scala and .class files as well as the ASMified .class file.
What am I missing?
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
--94eb2c03d95ea40840054a26d50d
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">My understanding of value-classes led me to believe that u=
sages of <a href=3D"https://github.com/scala/scala/blob/v2.12.1/src/library=
/scala/Predef.scala#L308">the "->" from ArrowAssoc</a> would b=
e compiled out and run as if Tuple2's had been instantiated directly.<d=
iv><br></div><div>However, when I feed this file to scalac (2.12.1):</div><=
div><br></div><div><font face=3D"monospace">// Test.scala</font></div><div>=
<div><font face=3D"monospace">object Test {</font></div><div><font face=3D"=
monospace">=C2=A0 val tuple =3D "aaa" -> "bbb"</font=
></div><div><font face=3D"monospace">}</font></div></div><div><br></div><di=
v>I see instances of ArrowAssoc in the resulting bytecode.</div><div><br></=
div><div><a href=3D"https://gist.github.com/ryan-williams/20b96b78c3414e729=
2302a9e6f799e8a">Here's a gist</a> with the .scala and .class files as =
well as the ASMified .class file.</div><div><br></div><div>What am I missin=
g?</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;scala-language" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">scal=
[email protected]</a>.<br />
For more options, visit <a href=3D"https://groups.google.com/d/optout">http=
s://groups.google.com/d/optout</a>.<br />
--94eb2c03d95ea40840054a26d50d--