Skip to content

Remove temporary Y flag #11501

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

Merged
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
1 change: 0 additions & 1 deletion compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings {
val YerasedTerms: Setting[Boolean] = BooleanSetting("-Yerased-terms", "Allows the use of erased terms.")
val YcheckInit: Setting[Boolean] = BooleanSetting("-Ycheck-init", "Check initialization of objects")
val YrequireTargetName: Setting[Boolean] = BooleanSetting("-Yrequire-targetName", "Warn if an operator is defined without a @targetName annotation")
val YunsoundMatchTypes: Setting[Boolean] = BooleanSetting("-Yunsound-match-types", "Use unsound match type reduction algorithm.")

/** Area-specific debug output */
val YexplainLowlevel: Setting[Boolean] = BooleanSetting("-Yexplain-lowlevel", "When explaining type errors, show types at a lower level.")
Expand Down
10 changes: 3 additions & 7 deletions compiler/src/dotty/tools/dotc/core/TypeComparer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2523,20 +2523,16 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
case (tp1: TermRef, tp2: TermRef) if isEnumValueOrModule(tp1) && isEnumValueOrModule(tp2) =>
tp1.termSymbol != tp2.termSymbol
case (tp1: TypeProxy, tp2: TypeProxy) =>
provablyDisjoint(matchTypeSuperType(tp1), tp2) || provablyDisjoint(tp1, matchTypeSuperType(tp2))
provablyDisjoint(tp1.superType, tp2) || provablyDisjoint(tp1, tp2.superType)
case (tp1: TypeProxy, _) =>
provablyDisjoint(matchTypeSuperType(tp1), tp2)
provablyDisjoint(tp1.superType, tp2)
case (_, tp2: TypeProxy) =>
provablyDisjoint(tp1, matchTypeSuperType(tp2))
provablyDisjoint(tp1, tp2.superType)
case _ =>
false
}
}

/** Restores the buggy match type reduction under -Yunsound-match-types. */
private def matchTypeSuperType(tp: TypeProxy): Type =
if ctx.settings.YunsoundMatchTypes.value then tp.underlying else tp.superType

protected def explainingTypeComparer = ExplainingTypeComparer(comparerContext)
protected def trackingTypeComparer = TrackingTypeComparer(comparerContext)

Expand Down