Skip to content

Commit 02862f3

Browse files
Merge pull request #11501 from dotty-staging/remove-temporary-y-flag
Remove temporary Y flag
2 parents f96b298 + 553f993 commit 02862f3

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

compiler/src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ class ScalaSettings extends Settings.SettingGroup with CommonScalaSettings {
227227
val YerasedTerms: Setting[Boolean] = BooleanSetting("-Yerased-terms", "Allows the use of erased terms.")
228228
val YcheckInit: Setting[Boolean] = BooleanSetting("-Ycheck-init", "Check initialization of objects")
229229
val YrequireTargetName: Setting[Boolean] = BooleanSetting("-Yrequire-targetName", "Warn if an operator is defined without a @targetName annotation")
230-
val YunsoundMatchTypes: Setting[Boolean] = BooleanSetting("-Yunsound-match-types", "Use unsound match type reduction algorithm.")
231230

232231
/** Area-specific debug output */
233232
val YexplainLowlevel: Setting[Boolean] = BooleanSetting("-Yexplain-lowlevel", "When explaining type errors, show types at a lower level.")

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,20 +2522,16 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
25222522
case (tp1: TermRef, tp2: TermRef) if isEnumValueOrModule(tp1) && isEnumValueOrModule(tp2) =>
25232523
tp1.termSymbol != tp2.termSymbol
25242524
case (tp1: TypeProxy, tp2: TypeProxy) =>
2525-
provablyDisjoint(matchTypeSuperType(tp1), tp2) || provablyDisjoint(tp1, matchTypeSuperType(tp2))
2525+
provablyDisjoint(tp1.superType, tp2) || provablyDisjoint(tp1, tp2.superType)
25262526
case (tp1: TypeProxy, _) =>
2527-
provablyDisjoint(matchTypeSuperType(tp1), tp2)
2527+
provablyDisjoint(tp1.superType, tp2)
25282528
case (_, tp2: TypeProxy) =>
2529-
provablyDisjoint(tp1, matchTypeSuperType(tp2))
2529+
provablyDisjoint(tp1, tp2.superType)
25302530
case _ =>
25312531
false
25322532
}
25332533
}
25342534

2535-
/** Restores the buggy match type reduction under -Yunsound-match-types. */
2536-
private def matchTypeSuperType(tp: TypeProxy): Type =
2537-
if ctx.settings.YunsoundMatchTypes.value then tp.underlying else tp.superType
2538-
25392535
protected def explainingTypeComparer = ExplainingTypeComparer(comparerContext)
25402536
protected def trackingTypeComparer = TrackingTypeComparer(comparerContext)
25412537

0 commit comments

Comments
 (0)