From 6f4ac270757f072133acd6c32ab944ccf0a4da90 Mon Sep 17 00:00:00 2001 From: noti0na1 Date: Wed, 23 Mar 2022 12:27:19 -0400 Subject: [PATCH] Add name for the boolean argument --- compiler/src/dotty/tools/dotc/core/Types.scala | 2 +- compiler/src/dotty/tools/dotc/typer/RefChecks.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 6e16e73e6d63..47b83082bfdd 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -1080,7 +1080,7 @@ object Types { case tp @ MethodType(Nil) => tp.resultType case _ => tp } - val overrideCtx = if relaxedCheck && !ctx.mode.is(Mode.RelaxedOverriding) then ctx.relaxedOverrideContext else ctx + val overrideCtx = if relaxedCheck then ctx.relaxedOverrideContext else ctx inContext(overrideCtx) { !checkClassInfo && this.isInstanceOf[ClassInfo] || (this.widenExpr frozen_<:< that.widenExpr) diff --git a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala index 0a195409f9e8..0de3a03b167e 100644 --- a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala +++ b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala @@ -767,7 +767,7 @@ object RefChecks { for (mbrd <- self.member(name).alternatives) { val mbr = mbrd.symbol val mbrType = mbr.info.asSeenFrom(self, mbr.owner) - if (!mbrType.overrides(mbrd.info, false, matchLoosely = true)) + if (!mbrType.overrides(mbrd.info, relaxedCheck = false, matchLoosely = true)) report.errorOrMigrationWarning( em"""${mbr.showLocated} is not a legal implementation of `$name` in $clazz | its type $mbrType