Skip to content

Incremental compilation hiccup with sealed when switching branches or projects #25273

@som-snytt

Description

@som-snytt

Compiler version

3.8.2

Minimized code

I often need to clean when juggling projects or branches. Here, I'd run a bootstrapped test on a clean repository, switched branches (with the same build files), and wanted to run a nonbootstrapped test.

I did not "nail down" whether it's the project switch or the branch switch that fools incremental compilation.

sbt:scala3-bootstrapped> project scala3-nonbootstrapped
sbt:scala3-nonbootstrapped> testCompilation tests/neg/i24096.scala

Output

error] Cannot extend sealed class Either in a different source file
[error]   |
[error]   | longer explanation available when compiling with `-explain`
[error] Cannot extend sealed class Option in a different source file
[error]   |
[error]   | longer explanation available when compiling with `-explain`
[error] two errors found
[error] (scala-library-nonbootstrapped / Compile / compileIncremental) Compilation failed

Expectation

Obviously, the error is mistaken; non-obviously, maybe it can detect that a stale build artifact must be discarded or refreshed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions