Skip to content

Commit bbe74ce

Browse files
authored
Merge pull request #14466 from Xavientois/fix-assert-this-safe-init
2 parents 679f3d8 + 41d7c98 commit bbe74ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3877,9 +3877,6 @@ object Types {
38773877
val paramInfos: List[TypeBounds] = paramInfosExp(this)
38783878
val resType: Type = resultTypeExp(this)
38793879

3880-
assert(resType.isInstanceOf[TermType], this)
3881-
assert(paramNames.nonEmpty)
3882-
38833880
private def setVariances(tparams: List[LambdaParam], vs: List[Variance]): Unit =
38843881
if tparams.nonEmpty then
38853882
tparams.head.declaredVariance = vs.head
@@ -3931,6 +3928,9 @@ object Types {
39313928
if isDeclaredVarianceLambda then
39323929
s"HKTypeLambda($paramNames, $paramInfos, $resType, ${declaredVariances.map(_.flagsString)})"
39333930
else super.toString
3931+
3932+
assert(resType.isInstanceOf[TermType], this)
3933+
assert(paramNames.nonEmpty)
39343934
}
39353935

39363936
/** The type of a polymorphic method. It has the same form as HKTypeLambda,

0 commit comments

Comments
 (0)