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

Incremental compilation fails for class extending trait with export #11841

Open
pikinier20 opened this issue Mar 22, 2021 · 1 comment
Open

Comments

@pikinier20
Copy link
Contributor

Compiler version

3.0.0-RC1

Minimized code

First, we compile this code:

class SomeOps:
    def someOperation: String = "asd"
    // def someOperation2: String = "asd"
        
trait SomeTrait:
    object SomeOps extends SomeOps()
    export SomeOps._
    
class MainClass extends SomeTrait:
    def a(str: String): String = someOperation

Then, we change SomeOps:

class SomeOps:
        def someOperation: String = "asd"
        def someOperation2: String = "asd"

And use someOperation2 in MainClass

class MainClass extends SomeTrait:
    def a(str: String): String = someOperation2

When we try to compile that code now, it fails. After sbt clean it compiles.

Output

[error] -- [E006] Not Found Error: /home/fzybala/scala3bench/scala3/src/main/scala/MainClass.scala:4:33 
[error] 4 |    def a(str: String): String = someOperation2
[error]   |                                 ^^^^^^^^^^^^^^
[error]   |                                 Not found: someOperation2
[error] one error found
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 0 s, completed 22 mar 2021, 14:31:45

Expectation

This code is correct and compiles after cleaning outputs

@ckipp01
Copy link
Member

ckipp01 commented May 14, 2023

Note that trying this with 3.2.2 I m no longer seeing this issue. With that being said, even trying with 3.0.0-RC1 I'm unable to reproduce using sbt 1.8.2. Any change you can still reproduce this @pikinier20? If note I'd vote we go ahead and close this.

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

3 participants