-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Typer: Instability & Inconsistent Conformance Check Report #16950
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
Comments
Could you check if you can reproduce this issue with the latest nightly (in your sbt build, set |
@smarter: Unfortunately no. Symptom remains unchanged with 3.3.1-RC1-bin-20230218-7c9c72a-NIGHTLY. |
Thanks for checking. I assume the project contains multiple file, is the problem still reproducible in sbt if you delete the other files from this project? |
Here is the minimization I get to : file import b.*
object Foo:
def bar(x : YOf[K]):Unit = ???
bar(???) file package b
trait K:
type C
sealed trait X:
type CType <: YOf[C]
def foo : K#Y =
val x : CType = ???
x
sealed trait Y extends X
type YOf [+T] = K#Y {type M <: T} When compiled separately ( The bug appears using sbt. When sbt starts with
Observations:
|
Actually when |
Thanks! I was able to minimize it slightly more: object Foo:
def bar(x : YOf[Any]): Unit = ???
bar(???)
trait K:
trait X:
type CType <: YOf[Any]
def foo : K#X =
val x : CType = ???
x
type YOf[T] = K#X {type M} It seems to be a caching issue: while computing the right-hand side of |
A static TypeRef can still be provisional if it's currently being completed (see the logic in `Namer#TypeDefCompleter#typeSig`). Fixes scala#16950.
A static TypeRef can still be provisional if it's currently being completed (see the logic in `Namer#TypeDefCompleter#typeSig`). Fixes scala#16950.
A static TypeRef can still be provisional if it's currently being completed (see the logic in `Namer#TypeDefCompleter#typeSig`). Fixes scala#16950.
I have a PR up at #16989, meanwhile I think the only workaround is to move definitions around to change the order in which they're processed by the compiler as you already discovered. Note that the list of files passed to the compiler by sbt is sorted, so changing filenames is a reliable to change the order in which files are processed. |
Thank you for all. I already walked away from the scheme: too twisted ! |
A static TypeRef can still be provisional if it's currently being completed (see the logic in `Namer#TypeDefCompleter#typeSig`). Fixes #16950.
A static TypeRef can still be provisional if it's currently being completed (see the logic in `Namer#TypeDefCompleter#typeSig`). Fixes scala#16950.
Edited to reflect code minimization findings, absent from the original submission.
Compiler version
3.2.0, 3.2.2, 3.3.0-RC2
Minimized code
https://scastie.scala-lang.org/8oKKJzCeRMK0Coc7uaGKCw
Output
Scala compiler reports failed type conformance check (`...but the comparison trace ended with false).
However, the trace itself ends with true.
Expectation
Either
= false
Observations
object Foo
andtrait K
. https://scastie.scala-lang.org/UqVDSBaURW22P6Qsnw4ZgQ compiles correctly.object Foo
is not present in the file, the file compiles correctly by itself.object Foo
is present in another file, failure becomes dependent on the relative order of both files compilation, with a race condition.sbt
the race creates a memory effect: if a former compilation run left a valid tasty fortrait K
, issue disappears as well. ( sometimes untilsbt clean
, sometimes not )Any clue about what could cause the inconsistency in the report ?
The text was updated successfully, but these errors were encountered: