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

[Scala 2.12] Compilation error: Position.point on NoPosition #10448

Closed
guizmaii opened this issue Aug 2, 2017 · 17 comments
Closed

[Scala 2.12] Compilation error: Position.point on NoPosition #10448

guizmaii opened this issue Aug 2, 2017 · 17 comments

Comments

@guizmaii
Copy link

guizmaii commented Aug 2, 2017

Hi everyone,

A bug in the compilation of Scala projects with Scala 2.12 has been reported here: sbt/sbt#3314 and here: lagom/lagom#887 (comment)

It could be reproduced thanks to the Lagom PR (lagom/lagom#887) where I try to update the version of Scala used in Lagom.

Do you need more informations ?

@som-snytt
Copy link

som-snytt commented Aug 2, 2017

It looks like this comment and implementation:

// filter out setters if already warning for getter, indicated by position.
// also documentary names in patterns.
 all.filterNot(v =>
   v.symbol.isSetter && all.exists(g => g.symbol.isGetter && g.symbol.pos.point == v.symbol.pos.point)
  || atBounds.exists(x => v.symbol.pos.point == x.pos.point)
)

https://github.com/scala/scala/blob/v2.12.3/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala#L593

@som-snytt
Copy link

som-snytt commented Aug 2, 2017

In fact, there's already a fix floating around olafurpg/scala@d214b55

I'll PR it in a bit. IIRC, the position test was to ensure suppressing setter warning only for var and not paired getter/setter, but maybe that caution was unfounded.

@olafurpg
Copy link
Member

olafurpg commented Aug 7, 2017

I've been meaning to send that PR but didn't manage to find a minimal reproduction test the fix. Would love to see this fixed since I've hit on it a few times in my projects. I've worked around the issue so far by removing unused local terms.

@som-snytt
Copy link

@olafurpg Sorry I didn't get to it; I did look at an unused imports ticket that also had a sense of something else going on. The best solution is to register usages while typing, instead of examining trees later. Alternatively, use attachments to recover original trees, as is proposed. I'll make another attempt to diagnose and minimize this one.

@som-snytt
Copy link

For some reason, I don't get the lagom error. I tried my local lagom, and also the branch from the PR. I zapped my ~/.sbt in case that matters.

I noticed lagom build warned on some unused implicit params, and it took me a while to understand that -Xlint enables that (but not warning on non-implicit params).

I learned a bit about sbt debug after realizing sbt -Dxsbt.inc.debug=true didn't help me. I went here for guidance. I noticed the export artifacts that show how the compiler is invoked.

So I don't know where the unpositioned trees are coming from. I won't attempt the sbt repro, which has more intermediate steps. I'll try a test with a macro that emits unfriendly trees instead.

@forestofrain
Copy link

I get this compilation error often with implicits and refactoring. I am using SBT 1.0.3 and the issue in their tracker brought me here. It happens when I refactor case classes and haven't got around to fixing the compilation errors I have in at least a trait with implicit vals for spray json. I know that I introduced a breaking change, I compile it so that I can get a link in my editor to the broken code.

My exact instance was I had a sealed trait. All the defined implementations of this trait had an implicit formatter for spray json. Later, I deleted some of the implementations, but did not remove the implicit vals. Using my IDE, latest IntelliJ and Scala plugin, to compile I see the NoPosition error and no other errors. I reverted the changes, verified it compiled without error, and then repeated the steps to be greeted with the same error.

After deleting the invalid implicits and a compile, I get a few other errors could not find implicit value for evidence parameter of type .... This one always requires me to perform a ;clean'compile and they go away, another issue I see often. After the clean compilation, the NoPosition error is back. I am able to scroll back the output to actually see the last errors in a few callers that were using the deleted case classes.

[error] scala.reflect.internal.util.Position.fail(Position.scala:17)
[error] scala.reflect.internal.util.UndefinedPosition.point(Position.scala:95)
[error] scala.reflect.internal.util.UndefinedPosition.point(Position.scala:90)
[error] scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkUnused$UnusedPrivates.$anonfun$unusedTerms$4(TypeDiagnostics.scala:593)
[error] scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkUnused$UnusedPrivates.$anonfun$unusedTerms$4$adapted(TypeDiagnostics.scala:593)
[error] scala.collection.Iterator.exists(Iterator.scala:955)
[error] scala.collection.Iterator.exists$(Iterator.scala:953)
[error] scala.collection.AbstractIterator.exists(Iterator.scala:1417)
[error] scala.collection.IterableLike.exists(IterableLike.scala:76)
[error] scala.collection.IterableLike.exists$(IterableLike.scala:75)
[error] scala.collection.AbstractIterable.exists(Iterable.scala:54)
[error] scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkUnused$UnusedPrivates.$anonfun$unusedTerms$2(TypeDiagnostics.scala:593)
[error] scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkUnused$UnusedPrivates.$anonfun$unusedTerms$2$adapted(TypeDiagnostics.scala:591)
[error] scala.collection.TraversableLike.$anonfun$filterImpl$1(TraversableLike.scala:248)
[error] scala.collection.immutable.List.foreach(List.scala:389)
[error] scala.collection.TraversableLike.filterImpl(TraversableLike.scala:247)
[error] scala.collection.TraversableLike.filterImpl$(TraversableLike.scala:245)
[error] scala.collection.AbstractTraversable.filterImpl(Traversable.scala:104)
[error] scala.collection.TraversableLike.filterNot(TraversableLike.scala:267)
[error] scala.collection.TraversableLike.filterNot$(TraversableLike.scala:267)
[error] scala.collection.AbstractTraversable.filterNot(Traversable.scala:104)
[error] scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkUnused$UnusedPrivates.unusedTerms(TypeDiagnostics.scala:591)
[error] scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkUnused$.run(TypeDiagnostics.scala:626)
[error] scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkUnused$.apply(TypeDiagnostics.scala:697)
[error] scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:110)
[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:929)
[error] scala.collection.Iterator.foreach$(Iterator.scala:929)
[error] scala.collection.AbstractIterator.foreach(Iterator.scala:1417)
[error] scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
[error] scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1452)
[error] scala.tools.nsc.Global$Run.compileUnits(Global.scala:1436)
[error] scala.tools.nsc.Global$Run.compileSources(Global.scala:1429)
[error] scala.tools.nsc.Global$Run.compile(Global.scala:1545)
[error] xsbt.CachedCompiler0.run(CompilerInterface.scala:131)
[error] xsbt.CachedCompiler0.run(CompilerInterface.scala:106)
[error] xsbt.CompilerInterface.run(CompilerInterface.scala:32)
[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:81)
[error] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:132)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:72)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:115)
[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:117)
[error] sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:64)
[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:70)
[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:1403)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1385)
[error] scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42)
[error] sbt.std.Transform$$anon$4.work(System.scala:64)
[error] sbt.Execute.$anonfun$submit$2(Execute.scala:257)
[error] sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] sbt.Execute.work(Execute.scala:266)
[error] sbt.Execute.$anonfun$submit$1(Execute.scala:257)
[error] sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167)
[error] sbt.CompletionService$$anon$2.call(CompletionService.scala:32)
[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)
[error]            
[error] java.lang.UnsupportedOperationException: Position.point on NoPosition
[error] 	at scala.reflect.internal.util.Position.fail(Position.scala:17)
[error] 	at scala.reflect.internal.util.UndefinedPosition.point(Position.scala:95)
[error] 	at scala.reflect.internal.util.UndefinedPosition.point(Position.scala:90)
[error] 	at scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkUnused$UnusedPrivates.$anonfun$unusedTerms$4(TypeDiagnostics.scala:593)
[error] 	at scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkUnused$UnusedPrivates.$anonfun$unusedTerms$4$adapted(TypeDiagnostics.scala:593)
[error] 	at scala.collection.Iterator.exists(Iterator.scala:955)
[error] 	at scala.collection.Iterator.exists$(Iterator.scala:953)
[error] 	at scala.collection.AbstractIterator.exists(Iterator.scala:1417)
[error] 	at scala.collection.IterableLike.exists(IterableLike.scala:76)
[error] 	at scala.collection.IterableLike.exists$(IterableLike.scala:75)
[error] 	at scala.collection.AbstractIterable.exists(Iterable.scala:54)
[error] 	at scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkUnused$UnusedPrivates.$anonfun$unusedTerms$2(TypeDiagnostics.scala:593)
[error] 	at scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkUnused$UnusedPrivates.$anonfun$unusedTerms$2$adapted(TypeDiagnostics.scala:591)
[error] 	at scala.collection.TraversableLike.$anonfun$filterImpl$1(TraversableLike.scala:248)
[error] 	at scala.collection.immutable.List.foreach(List.scala:389)
[error] 	at scala.collection.TraversableLike.filterImpl(TraversableLike.scala:247)
[error] 	at scala.collection.TraversableLike.filterImpl$(TraversableLike.scala:245)
[error] 	at scala.collection.AbstractTraversable.filterImpl(Traversable.scala:104)
[error] 	at scala.collection.TraversableLike.filterNot(TraversableLike.scala:267)
[error] 	at scala.collection.TraversableLike.filterNot$(TraversableLike.scala:267)
[error] 	at scala.collection.AbstractTraversable.filterNot(Traversable.scala:104)
[error] 	at scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkUnused$UnusedPrivates.unusedTerms(TypeDiagnostics.scala:591)
[error] 	at scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkUnused$.run(TypeDiagnostics.scala:626)
[error] 	at scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkUnused$.apply(TypeDiagnostics.scala:697)
[error] 	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:110)
[error] 	at scala.tools.nsc.Global$GlobalPhase.$anonfun$applyPhase$1(Global.scala:436)
[error] 	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:429)
[error] 	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1(Analyzer.scala:94)
[error] 	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1$adapted(Analyzer.scala:93)
[error] 	at scala.collection.Iterator.foreach(Iterator.scala:929)
[error] 	at scala.collection.Iterator.foreach$(Iterator.scala:929)
[error] 	at scala.collection.AbstractIterator.foreach(Iterator.scala:1417)
[error] 	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
[error] 	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1452)
[error] 	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1436)
[error] 	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1429)
[error] 	at scala.tools.nsc.Global$Run.compile(Global.scala:1545)
[error] 	at xsbt.CachedCompiler0.run(CompilerInterface.scala:131)
[error] 	at xsbt.CachedCompiler0.run(CompilerInterface.scala:106)
[error] 	at xsbt.CompilerInterface.run(CompilerInterface.scala:32)
[error] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] 	at java.lang.reflect.Method.invoke(Method.java:498)
[error] 	at sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:237)
[error] 	at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:111)
[error] 	at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:90)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:81)
[error] 	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:132)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:72)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:115)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:305)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:305)
[error] 	at sbt.internal.inc.Incremental$.doCompile(Incremental.scala:101)
[error] 	at sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:82)
[error] 	at sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:117)
[error] 	at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:64)
[error] 	at sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:84)
[error] 	at sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:129)
[error] 	at sbt.internal.inc.Incremental$.compile(Incremental.scala:75)
[error] 	at sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:70)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:309)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:267)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:158)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:237)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:68)
[error] 	at sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:1403)
[error] 	at sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1385)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42)
[error] 	at sbt.std.Transform$$anon$4.work(System.scala:64)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:257)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] 	at sbt.Execute.work(Execute.scala:266)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:257)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:32)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] 	at java.lang.Thread.run(Thread.java:748)

@adamw
Copy link

adamw commented Dec 8, 2017

I'm getting the same error (unfortunately I can't share the source), however removing -Xlint from scalacOptions in sbt "fixes" the problem.

@olafurpg
Copy link
Member

I opened scala/scala#6232 to change the implementation in TypeDiagnostics to not rely on Position.point. I haven't yet been able to find a minimal reproduction, if someone has a small test that triggers this crash then that would be a nice addition to the PR.

trepidacious added a commit to trepidacious/tree-material-ui that referenced this issue Jan 6, 2018
Might also be useful to reproduce
scala/bug#10448 :)
aullik added a commit to Zeta-Project/zeta that referenced this issue Jan 8, 2018
@SethTisue SethTisue added this to the 2.12.5 milestone Jan 16, 2018
guizmaii added a commit to Colisweb/scala-distances that referenced this issue Jan 19, 2018
@guizmaii
Copy link
Author

guizmaii commented Jan 19, 2018

Hi @olafurpg,

I don't know if it can help but I reproduced the bug during my work on one of my open source project. I saved the code that reproduces the bug here: Colisweb/scala-distances#15

It's some very bad code because it's work in progress.
It should not compile but instead of failing to compile the code, scalac reproduces the bug reported here.

In order to make the compiler succeed, you just have to comment the code of the function fetchAndCache here: https://github.com/guizmaii/scala-distances/pull/15/files#diff-7ebcb96be77804d6879a551ec652858aR68

Hope it will help.

I didn't succeed to reproduce the bug in a smaller project unfortunately.

@som-snytt
Copy link

@guizmaii Thanks, I'm pushing a new PR, a test case is great! I'll take a look.

@fanf
Copy link

fanf commented Jan 20, 2018

Some more information: I can use these compiler flags:

-target:jvm-1.8
-Ypartial-unification
-dependencyfile
xxx/.scala_dependencies
-feature
-unchecked
-deprecation
-explaintypes
-Ypartial-unification
-language:existentials
-language:higherKinds
-language:implicitConversions
-Yno-adapted-args
-Ywarn-dead-code
-Ywarn-extra-implicit
-Ywarn-inaccessible
-Ywarn-infer-any
-Ywarn-nullary-override
-Ywarn-unused:imports

But as soon as I add any of

-Ywarn-unused:privates
-Xlint
-Ywarn-unused:locals

I get the compiler error, ie even that will fail:

-target:jvm-1.8
-Ypartial-unification
-dependencyfile
xxx/.scala_dependencies
-Ywarn-unused:locals

I can use these compiler flag in my maven build without getting any error. I tested on both eclipse IDE and Inteliij IDEA.

@som-snytt
Copy link

I checked the fix against scala-distances. I added it to the existing PR of related improvements.

scala/scala@b16b2a9

Warning about PatVarDefs like val C(x) = ??? is moved from -Ywarn-unused:privates,locals to -Ywarn-unused:patvars.

@fanf
Copy link

fanf commented Jan 20, 2018

Not sure if related, but now I'm getting an other error. Perhaps look more like #10604 though:

null
scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:773)
scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5584)
scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5616)
scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5557)
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5562)
scala.tools.nsc.typechecker.Typers$Typer.transformedOrTyped(Typers.scala:5798)
scala.tools.nsc.typechecker.Typers$Typer.typedValDefImpl(Typers.scala:2068)
scala.tools.nsc.typechecker.Typers$Typer.typedValDef(Typers.scala:2024)
scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5494)
scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5546)
scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:773)
scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5584)
scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5616)
scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5557)
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5562)
scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5647)
scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3086)
scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3231)
scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3231)
scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2456)
scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typed1$96(Typers.scala:5505)
scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typerWithLocalContext$1(Typers.scala:486)
scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:486)
scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5540)
scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5547)
scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:773)
... again and again and again ...

@som-snytt
Copy link

I could have used this fix today. I hadn't seen the behavior before, but adding -Yno-imports to the standard library build does enough damage to induce the error under -Xlint.

@lrytz
Copy link
Member

lrytz commented Feb 22, 2018

Fixed in scala/scala#6190

@lrytz lrytz closed this as completed Feb 22, 2018
@nafg
Copy link

nafg commented Mar 8, 2018

I'm still getting this error with 2.12.5-bin-fa80d7b

@nafg
Copy link

nafg commented Mar 8, 2018

Sorry, I think it was a mistake on my part. It seems it was a false alarm.

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

10 participants