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

Fix caching issue caused by incorrect isProvisional check #16989

Merged
merged 1 commit into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,9 @@ object Types {
if t.mightBeProvisional then
t.mightBeProvisional = t match
case t: TypeRef =>
!t.currentSymbol.isStatic && {
t.currentSymbol.isProvisional || !t.currentSymbol.isStatic && {
(t: Type).mightBeProvisional = false // break cycles
t.symbol.isProvisional
|| test(t.prefix, theAcc)
test(t.prefix, theAcc)
|| t.denot.infoOrCompleter.match
case info: LazyType => true
case info: AliasingBounds => test(info.alias, theAcc)
Expand Down
11 changes: 11 additions & 0 deletions tests/pos/i16950.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
object Foo:
def bar(x : Bar.YOf[Any]): Unit = ???

trait K:
type CType <: Bar.YOf[Any]
def foo : K =
val x : CType = ???
x // was: error: Found: CType, Expected: K

object Bar:
type YOf[T] = K { type M }