Skip to content

Commit 1606919

Browse files
committed
Polishings
1 parent 2b36be0 commit 1606919

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

compiler/src/dotty/tools/dotc/transform/Recheck.scala

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ abstract class Recheck extends Phase, IdentityDenotTransformer:
2626

2727
override def isEnabled(using Context) = ctx.settings.Yrecheck.value
2828
override def changesBaseTypes: Boolean = true
29+
2930
override def isCheckable = false
31+
// TODO: investigate what goes wrong we Ycheck directly after rechecking.
32+
// One failing test is pos/i583a.scala
3033

3134
def run(using Context): Unit =
3235
val unit = ctx.compilationUnit
@@ -101,19 +104,6 @@ abstract class Recheck extends Phase, IdentityDenotTransformer:
101104
def recheckDefDef(tree: DefDef, sym: Symbol)(using Context): Type =
102105
tree.paramss.foreach(_.foreach(enterDef))
103106
val rhsCtx = linkConstructorParams(sym)
104-
/*if sym.isConstructor && !sym.isPrimaryConstructor then
105-
// For secondary constructors we need a context that "knows"
106-
// that their type parameters are aliases of the class type parameters.
107-
// See pos/i941.scala
108-
val tparamSyms = sym.paramSymss.flatten.filter(_.isType)
109-
if tparamSyms.nonEmpty then
110-
rhsCtx.setFreshGADTBounds
111-
rhsCtx.gadt.addToConstraint(tparamSyms)
112-
tparamSyms.lazyZip(sym.owner.typeParams).foreach { (psym, tparam) =>
113-
val tr = tparam.typeRef
114-
rhsCtx.gadt.addBound(psym, tr, isUpper = false)
115-
rhsCtx.gadt.addBound(psym, tr, isUpper = true)
116-
}*/
117107
if !tree.rhs.isEmpty && !sym.isInlineMethod && !sym.isEffectivelyErased then
118108
recheck(tree.rhs, tree.symbol.localReturnType)(using rhsCtx)
119109
sym.termRef

0 commit comments

Comments
 (0)