Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.13.0-M3 compiler crash with "Synthetic tree ... contains nonsynthetic tree" #10706

Closed
xuwei-k opened this issue Feb 2, 2018 · 1 comment
Closed
Assignees
Milestone

Comments

@xuwei-k
Copy link

xuwei-k commented Feb 2, 2018

same message as #8510 , #10095 .
but scalaz 7.3 does not use macros and another versions(Scala 2.11.12, 2.12.4) builds fine

how to reproduce

git clone -b ambig-implicit https://github.com/xuwei-k/scalaz.git
cd scalaz
sbt '++ 2.13.0-M3!' rootJVM/test:compile

error log

[info] ======= Position error
[info] Synthetic tree [910795] contains nonsynthetic tree [910792]
[info] == Enclosing tree [910795] of type ValDef at [2917]TupleTest.scala
[info] [L  79        ] #910795 [2917]          ValDef     // term stabilizer$1
[info] == Enclosed tree [910792] of type Apply at [2917:2923]TupleTest.scala
[info] [L  79        ] #910792 [2917:2923]     ApplyImplicitView // (1, 2).
[info] 
[info] While validating #913465
[info] [L   1        ] #913465 [0:4863]        PackageDef // scalaz
[info] 
[info] Children:
[info]   [L   1 P#913465] #95843  [8:14]          Ident      // scalaz
[info]   [L   2 P#913465] #913464 [15:4863]       PackageDef // std
[info] =======
[error] ## Exception when compiling 151 sources to /home/travis/build/xuwei-k/scalaz/tests/jvm/target/scala-2.13.0-M3/test-classes
[error] Synthetic tree [910795] contains nonsynthetic tree [910792]
[error] scala.reflect.internal.Positions.validate$1(Positions.scala:105)
[error] scala.reflect.internal.Positions.$anonfun$validatePositions$12(Positions.scala:145)
[error] scala.reflect.internal.Positions.validate$1(Positions.scala:145)
[error] scala.reflect.internal.Positions.$anonfun$validatePositions$12(Positions.scala:145)
[error] scala.reflect.internal.Positions.validate$1(Positions.scala:145)
[error] scala.reflect.internal.Positions.$anonfun$validatePositions$12(Positions.scala:145)
[error] scala.reflect.internal.Positions.validate$1(Positions.scala:145)
[error] scala.reflect.internal.Positions.$anonfun$validatePositions$12(Positions.scala:145)
[error] scala.reflect.internal.Positions.validate$1(Positions.scala:145)
[error] scala.reflect.internal.Positions.$anonfun$validatePositions$12(Positions.scala:145)
[error] scala.reflect.internal.Positions.validate$1(Positions.scala:145)
[error] scala.reflect.internal.Positions.$anonfun$validatePositions$12(Positions.scala:145)
[error] scala.reflect.internal.Positions.validate$1(Positions.scala:145)
[error] scala.reflect.internal.Positions.validatePositions(Positions.scala:150)
[error] scala.reflect.internal.Positions.validatePositions$(Positions.scala:86)
[error] scala.reflect.internal.SymbolTable.validatePositions(SymbolTable.scala:16)
[error] scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:105)
[error] scala.tools.nsc.Global$GlobalPhase.$anonfun$applyPhase$1(Global.scala:436)
[error] scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:429)
[error] scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1(Analyzer.scala:94)
[error] scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1$adapted(Analyzer.scala:93)
[error] scala.collection.Iterator.foreach(Iterator.scala:938)
[error] scala.collection.Iterator.foreach$(Iterator.scala:938)
[error] scala.collection.AbstractIterator.foreach(Iterator.scala:1426)
[error] scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
[error] scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1453)
[error] scala.tools.nsc.Global$Run.compileUnits(Global.scala:1437)
[error] scala.tools.nsc.Global$Run.compileSources(Global.scala:1429)
[error] scala.tools.nsc.Global$Run.compile(Global.scala:1546)
[error] xsbt.CachedCompiler0.run(CompilerInterface.scala:130)
[error] xsbt.CachedCompiler0.run(CompilerInterface.scala:105)
[error] xsbt.CompilerInterface.run(CompilerInterface.scala:31)
[error] sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] java.lang.reflect.Method.invoke(Method.java:498)
[error] sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:237)
[error] sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:111)
[error] sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:90)
[error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:83)
[error] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:134)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:74)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:117)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:305)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:305)
[error] sbt.internal.inc.Incremental$.doCompile(Incremental.scala:101)
[error] sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:82)
[error] sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:110)
[error] sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:57)
[error] sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:84)
[error] sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:129)
[error] sbt.internal.inc.Incremental$.compile(Incremental.scala:75)
[error] sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:61)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:309)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:267)
[error] sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:158)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:237)
[error] sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:68)
[error] sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:1427)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1401)
[error] scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error] sbt.std.Transform$$anon$4.work(System.scala:66)
[error] sbt.Execute.$anonfun$submit$2(Execute.scala:262)
[error] sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] sbt.Execute.work(Execute.scala:271)
[error] sbt.Execute.$anonfun$submit$1(Execute.scala:262)
[error] sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:174)
[error] sbt.CompletionService$$anon$2.call(CompletionService.scala:36)
[error] java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] java.lang.Thread.run(Thread.java:748)
xuwei-k added a commit to joroKr21/scalaz that referenced this issue Feb 2, 2018
xuwei-k pushed a commit to scalaz/scalaz that referenced this issue Feb 2, 2018
* Resolve ambiguous implicits for Scala 2.13.0-M3

In preparation. There may be more but this is what the tests caugth.

* scalacheck_2.13.0-M3 released (only jvm). enable Scala 2.13.0-M3 jvm test

* remove "-Yrangepos" scalac option

scala/bug#10706
@hrhino
Copy link

hrhino commented Feb 2, 2018

Related to scala/scala#5999?

@hrhino hrhino self-assigned this Feb 6, 2018
hrhino added a commit to hrhino/scala that referenced this issue Feb 13, 2018
…ing val.

Not because we're going to do anything else with the old one,
but because rangepos expects offset-positioned trees not to
contain range-positioned trees. This is the same approach that
default arguments use when moving the RHS of the parameter val
into a default getter.

Alternatives:
- Remove that assertion: I'm not sure what it's for, but the
  validation seems quite insistent on that point. I suspect
  that the IDE or PC or something using positions may break
  on that.
- Use the tree duplicator (and don't make a focuser traverser).
  This is how the default args are currently done, but since
  we're not reusing `qual` here that I can see it doesn't seem
  too useful to waste the allocations that it would take to
  duplicate that tree.

The test cases are just slapping `-Yrangepos` on all of the
test cases introduced in bcbe993 (where this feature was
introduced).

`test/files/pos/t4225.scala` is not thus enhanced, since
there's a similar rangeposly error with by-name arguments
of right-associative methods.

Fixes scala/bug#10706.
hrhino added a commit to hrhino/scala that referenced this issue Feb 13, 2018
…ing val.

...because rangepos expects offset-positioned trees not to
contain range-positioned trees. This is the same approach that
default arguments use when moving the RHS of the parameter val
into a default getter.

Alternatives:
- Remove that assertion: I'm not sure what it's for, but the
  validation seems quite insistent on that point. I suspect
  that the IDE or PC or something using positions may break
  on that.
- Use the tree duplicator (and don't make a focuser traverser).
  This is how the default args are currently done, but since
  we're not reusing `qual` here that I can see it doesn't seem
  too useful to waste the allocations that it would take to
  duplicate that tree.

The test cases are just slapping `-Yrangepos` on all of the
test cases introduced in bcbe993 (where this feature was
introduced).

`test/files/pos/t4225.scala` is not thus enhanced, since
there's a similar rangeposly error with by-name arguments
of right-associative methods.

Fixes scala/bug#10706.
@hrhino hrhino added this to the 2.13.0-M4 milestone Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants