@@ -26,7 +26,10 @@ abstract class Recheck extends Phase, IdentityDenotTransformer:
26
26
27
27
override def isEnabled (using Context ) = ctx.settings.Yrecheck .value
28
28
override def changesBaseTypes : Boolean = true
29
+
29
30
override def isCheckable = false
31
+ // TODO: investigate what goes wrong we Ycheck directly after rechecking.
32
+ // One failing test is pos/i583a.scala
30
33
31
34
def run (using Context ): Unit =
32
35
val unit = ctx.compilationUnit
@@ -101,19 +104,6 @@ abstract class Recheck extends Phase, IdentityDenotTransformer:
101
104
def recheckDefDef (tree : DefDef , sym : Symbol )(using Context ): Type =
102
105
tree.paramss.foreach(_.foreach(enterDef))
103
106
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
- }*/
117
107
if ! tree.rhs.isEmpty && ! sym.isInlineMethod && ! sym.isEffectivelyErased then
118
108
recheck(tree.rhs, tree.symbol.localReturnType)(using rhsCtx)
119
109
sym.termRef
0 commit comments