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

MatchError in ApiPhase #963

Open
dwijnand opened this issue Jan 27, 2021 · 3 comments
Open

MatchError in ApiPhase #963

dwijnand opened this issue Jan 27, 2021 · 3 comments
Labels

Comments

@dwijnand
Copy link
Member

steps

Sorry, I don't have exact steps, but after this happening a few times in a row in the same hour I thought I'd still report it to get the ball rolling. Basically I rebased a branch and compiled...

problem

[error] ## Exception when compiling 566 sources to /d/scala/build/quick/classes/library
[error] scala.MatchError: /d/scala/src/library/scala/collection/Seq.scala (of class scala.reflect.io.PlainFile)
[error] xsbt.API$ApiPhase.processScalaUnit(API.scala:62)
[error] xsbt.API$ApiPhase.processUnit(API.scala:57)
[error] xsbt.API$ApiPhase.apply(API.scala:53)
[error] scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:454)
[error] scala.tools.nsc.Global$GlobalPhase.run(Global.scala:401)
[error] xsbt.API$ApiPhase.run(API.scala:35)
[error] scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1515)
[error] scala.tools.nsc.Global$Run.compileUnits(Global.scala:1499)
[error] scala.tools.nsc.Global$Run.compileSources(Global.scala:1491)
[error] scala.tools.nsc.Global$Run.compileFiles(Global.scala:1605)
[error] xsbt.CachedCompiler0.run(CompilerBridge.scala:163)
[error] xsbt.CachedCompiler0.run(CompilerBridge.scala:134)
[error] xsbt.CompilerBridge.run(CompilerBridge.scala:39)
[error] sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:92)

expectation

Non-partial pattern matches...

notes

After a rm build/quick/classes/library/scala/collection/Seq* it fixed it self, thankfully:

> mimaReportBinaryIssues
[info] root: mimaPreviousArtifacts not set, not analyzing binary compatibility
[info] running scala.tools.docutil.ManMaker "fsc, scala, scalac, scaladoc, scalap" /d/scala/target/scalaDist/resource_managed/main/doc/tools /d/scala/target/scalaDist/resource_managed/main/genman
[info] compiling 11 Scala sources to /d/scala/build/quick/classes/library ...
[info] compiling 17 Scala sources to /d/scala/build/quick/classes/library ...
[info] compiling 2 Scala sources to /d/scala/build/quick/classes/reflect ...
[info] compiling 7 Scala sources to /d/scala/build/quick/classes/compiler ...
[error] scala-library: Failed binary compatibility check against org.scala-lang:scala-library:2.13.4! Found 31 potential problems (filtered 1)
@dwijnand dwijnand added the bug label Jan 27, 2021
@eed3si9n
Copy link
Member

PlainFile vs virtual file it seems:

val sourceFile: VirtualFile = unit.source.file match { case AbstractZincFile(vf) => vf }

@som-snytt
Copy link
Contributor

Me too.

sbt:root> junit/testOnly test.scala.sys.process.ProcessTest
[info] compiling 3 Scala sources to /home/amarki/projects/scala/build/quick/classes/library ...
[error] ## Exception when compiling 569 sources to /home/amarki/projects/scala/build/quick/classes/library
[error] scala.MatchError: /home/amarki/projects/scala/src/library/scala/sys/process/ProcessBuilder.scala (of class scala.reflect.io.PlainFile)
[error] xsbt.API$ApiPhase.processScalaUnit(API.scala:62)
[error] xsbt.API$ApiPhase.processUnit(API.scala:57)
[error] xsbt.API$ApiPhase.apply(API.scala:53)
[error] scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:467)
[error] scala.tools.nsc.Global$GlobalPhase.run(Global.scala:414)
[error] xsbt.API$ApiPhase.run(API.scala:35)
[error] scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1530)
[error] scala.tools.nsc.Global$Run.compileUnits(Global.scala:1514)
[error] scala.tools.nsc.Global$Run.compileSources(Global.scala:1506)
[error] scala.tools.nsc.Global$Run.compileFiles(Global.scala:1619)
[error] xsbt.CachedCompiler0.run(CompilerBridge.scala:163)

Restarting sbt didn't help, but taking the hint, deleting the package classes worked. I'm pretty sure it started after an edit of the source file.

@som-snytt
Copy link
Contributor

som-snytt commented Nov 10, 2022

Tonight my me-too moment was also with Seq.scala.

One may ask, well how often does one edit Seq.scala. Actually, I was editing Iterator.scala too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants