Skip to content

Incremental compilation does not work if modified code is imported from a module that exported said code from elsewhere. #18216

Open
@phrmoy

Description

@phrmoy

Compiler version

3.3.0

Minimized code

ModuleA.scala

object ModuleA {
  def func(x:Int) = x
}

ModuleB.scala

object ModuleB {
  export ModuleA.{*}
}

ModuleC.scala

object ModuleC {
  import ModuleB.{*}
  println(func(0))
}

The above works. Now if I change the ModuleA.scala to

ModuleA.scala

object ModuleA {
  def func(x:Int, y:Int) = x + y
}

and change ModuleC.scala to

ModuleC.scala

object ModuleC {
  import ModuleB.{*}
  println(func(0,0))
}

Both SBT and bloop fail to compile the code.

Bloop v1.5.6.
SBT v1.8.3

Output

From SBT

[error] 11 |  println(func(0, 0))
[error]    |               ^^^^
[error]    |               Found:    (Int, Int)
[error]    |               Required: Int
[error]    |----------------------------------------------------------------------------
[error]    | Explanation (enabled by `-explain`)
[error]    |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

From Bloop

Found:    (Int, Int)
Required: Int

Expectation

Expected code to compile normally.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions