Re: [scala-bts] (SI-8425) Crash in constructors phase involving macros

23 views
Skip to first unread message

Jason Zaugg

unread,
Mar 17, 2014, 7:33:03 PM3/17/14
to Grzegorz Kossakowski (JIRA)
Yeah, there are plenty of workarounds. But they must be made by the macro author, and yet may only show up  under certain downstream usage patterns. Because freshname was an existing API in 2.10, I'm a bit heisitant to release with this known issue. 

On Tuesday, March 18, 2014, Grzegorz Kossakowski (JIRA) <scala-i...@googlegroups.com> wrote:

    [ https://issues.scala-lang.org/browse/SI-8425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=68886#comment-68886 ]

Grzegorz Kossakowski commented on SI-8425:
------------------------------------------

Thanks Jason for tacking it down.

Is there a work-around present for this issue that users can employ? What about striping additional dollar in case it got returned by {{freshName}}?

Let's step back from the excitement and look at the landscape: it's a regression that has been detected in tests of just one project using an experimental feature. If there's a work-around then I'd like to demote this to Major and I don't think we should block the release.

> Crash in constructors phase involving macros
> --------------------------------------------
>
>                 Key: SI-8425
>                 URL: https://issues.scala-lang.org/browse/SI-8425
>             Project: Scala Programming Language
>          Issue Type: Bug
>    Affects Versions: Scala 2.11.0-RC1
>            Reporter: Grzegorz Kossakowski
>            Assignee: Eugene Burmako
>            Priority: Critical
>             Fix For: Scala 2.10.3-RC3
>
>
> When compiling {{tests}} subproject of {{spire}} we get a compiler crash in constructors phase:
> {code}
> [info] [info] Compiling 43 Scala sources to /Users/grek/scala/community-builds/target-0.8.0/project-builds/spire-a623899e2c648c1777951bb52e29d9f5981bee20/tests/target/scala-2.11.0-dbuildx1ef8223e86d2dca416641a53dcfc648d1a7933e9/test-classes...
> [info] [error] macro$18$1 not in List(value $outer, value macro$18$1)
> [info] scala.reflect.internal.FatalError: macro$18$1 not in List(value $outer, value macro$18$1)
> [info]        at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:57)
> [info]        at scala.tools.nsc.Global.abort(Global.scala:268)
> [info]        at scala.tools.nsc.transform.Constructors$TemplateTransformer.parameterNamed(Constructors.scala:504)
> [info]        at scala.tools.nsc.transform.Constructors$TemplateTransformer.parameter(Constructors.scala:496)
> [info]        at scala.tools.nsc.transform.Constructors$TemplateTransformer$$anonfun$15.apply(Constructors.scala:690)
> [info]        at scala.tools.nsc.transform.Constructors$TemplateTransformer$$anonfun$15.apply(Constructors.scala:681)
> [info]        at scala.collection.immutable.List.map(List.scala:274)
> [info]        at scala.tools.nsc.transform.Constructors$TemplateTransformer.<init>(Constructors.scala:681)
> [info]        at scala.tools.nsc.transform.Constructors$ConstructorTransformer.transform(Constructors.scala:83)
> [info]        at scala.tools.nsc.transform.Constructors$TemplateTransformer$$anonfun$13.apply(Constructors.scala:672)
> [info]        at scala.tools.nsc.transform.Constructors$TemplateTransformer$$anonfun$13.apply(Constructors.scala:638)
> [info]        at scala.collection.immutable.List.foreach(List.scala:383)
> [info]        at scala.tools.nsc.transform.Constructors$TemplateTransformer.<init>(Constructors.scala:638)
> [info]        at scala.tools.nsc.transform.Constructors$ConstructorTransformer.transform(Constructors.scala:83)
> [info]        at scala.tools.nsc.transform.Constructors$TemplateTransformer$$anonfun$13.apply(Constructors.scala:672)
> [info]        at scala.tools.nsc.transform.Constructors$TemplateTransformer$$anonfun$13.apply(Constructors.scala:638)
> [info]        at scala.collection.immutable.List.foreach(List.scala:383)
> [info]        at scala.tools.nsc.transform.Constructors$TemplateTransformer.<init>(Constructors.scala:638)
> [info]        at scala.tools.nsc.transform.Constructors$ConstructorTransformer.transform(Constructors.scala:83)
> [info]        at scala.tools.nsc.transform.Constructors$ConstructorTransformer.transform(Constructors.scala:29)
> [info]        at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2589)
> [info]        at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:2587)
> [info]        at scala.collection.immutable.List.loop$1(

Grzegorz Kossakowski

unread,
Mar 17, 2014, 7:48:05 PM3/17/14
to scala-internals
On 18 March 2014 00:33, Jason Zaugg <jza...@gmail.com> wrote:
Yeah, there are plenty of workarounds. But they must be made by the macro author, and yet may only show up  under certain downstream usage patterns. Because freshname was an existing API in 2.10, I'm a bit heisitant to release with this known issue. 

After thinking more about it: I think the fact it's regression and the confusing manifestation of the problem (obscure crash in distant compiler phase) ois convincing enough to seriously consider fixing before shipping final.

On unrelated note: Jason,I see that you used shapeless release that appears to be released against Scala 2.11 final but there's no final. It looks like shapeless has a problem with its sbt cross-versioning publishing configuration.

--
Grzegorz Kossakowski
Scalac hacker at Typesafe
twitter: @gkossakowski

Grzegorz Kossakowski

unread,
Mar 17, 2014, 8:38:35 PM3/17/14
to scala-internals
On 18 March 2014 00:48, Grzegorz Kossakowski <grzegorz.k...@gmail.com> wrote:


On unrelated note: Jason,I see that you used shapeless release that appears to be released against Scala 2.11 final but there's no final. It looks like shapeless has a problem with its sbt cross-versioning publishing configuration.

[responding here so we don't go off topic on the ticket]

I looked at shapeless build and found a few disconcerting bits. Documented here: https://github.com/milessabin/shapeless/issues/84
Reply all
Reply to author
Forward
0 new messages