Skip to content

Commit ff37b45

Browse files
committed
Loosen skolem comparisons when rechecking
Treat a SolemType(T) as a supertype (as well as a subtype) of T.
1 parent 2b88f1c commit ff37b45

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ object Phases {
295295
/** If set, implicit search is enabled */
296296
def allowsImplicitSearch: Boolean = false
297297

298+
/** Is set equate Skolem types with underlying types */
299+
def widenSkolems: Boolean = true
300+
298301
/** List of names of phases that should precede this phase */
299302
def runsAfter: Set[String] = Set.empty
300303

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,8 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
745745
false
746746
}
747747
compareClassInfo
748+
case tp2: SkolemType =>
749+
ctx.phase.widenSkolems && recur(tp1, tp2.info) || fourthTry
748750
case _ =>
749751
fourthTry
750752
}
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
# Cannot compensate dealiasing due to false result dependency
22
i6635a.scala
33
i6682a.scala
4-
5-
# Cannot handle closures with skolem types
6-
i6199b.scala
7-
i6199c.scala
8-
i11247.scala

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,11 @@ class CompilationTests {
229229
).checkCompile()
230230

231231

232-
/** The purpose of this test is three-fold, being able to compile dotty
233-
* bootstrapped, and making sure that TASTY can link against a compiled
234-
* version of Dotty, and compiling the compiler using the SemanticDB generation
232+
/** This test serves several purposes:
233+
* - being able to compile dotty bootstrapped,
234+
* - making sure that TASTY can link against a compiled version of Dotty,
235+
* - compiling the compiler using the SemanticDB generation
236+
* - compiling the compiler under -Yrecheck mode.
235237
*/
236238
@Test def tastyBootstrap: Unit = {
237239
implicit val testGroup: TestGroup = TestGroup("tastyBootstrap/tests")

0 commit comments

Comments
 (0)