Open
Description
Clean complete compilation works, but if we leave a single-line commented, compile and then uncomment it, then we get the error.
Compiler version
v3.1.0-RC1
Minimized code
Minimized project available at: https://github.com/soronpo/dottybug/tree/inc_comp_opaque_error
MyOpaque.scala
trait Container[T]
opaque type MyOpaque[W <: Int] = Int
extension [W <: Int](myOpaque: MyOpaque[W]) def getContainer: Container[W] = ???
Test.scala
val myOpaque: MyOpaque[8] = ???
val container = myOpaque.getContainer
//after successful compilation, uncomment the following line to get the error
//val shouldWork = summon[container.type <:< Container[8]]
Output
[error] 4 |val shouldWork = summon[container.type <:< Container[8]]
[error] | ^
[error] | Cannot prove that (container : Container[Int]) <:< Container[(8 : Int)].
[error] one error found
Expectation
No error in incremental compilation.