diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/TypeComparer.scala | 2 | ||||
-rw-r--r-- | compiler/test/dotc/tests.scala | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index 6063cbf38..fca111702 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -489,7 +489,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling { case tp1 @ MethodType(_, formals1) => (tp1.signature consistentParams tp2.signature) && matchingParams(formals1, formals2, tp1.isJava, tp2.isJava) && - (!tp1.isImplicit || tp2.isImplicit) && // non-implicit functions shadow implicit ones + (tp1.isImplicit == tp2.isImplicit) && isSubType(tp1.resultType, tp2.resultType.subst(tp2, tp1)) case _ => false diff --git a/compiler/test/dotc/tests.scala b/compiler/test/dotc/tests.scala index 7af903364..6b11d8ba0 100644 --- a/compiler/test/dotc/tests.scala +++ b/compiler/test/dotc/tests.scala @@ -196,6 +196,7 @@ class tests extends CompilerTest { @Test def neg_nopredef = compileFile(negCustomArgs, "nopredef", List("-Yno-predef")) @Test def neg_noimports = compileFile(negCustomArgs, "noimports", List("-Yno-imports")) @Test def neg_noimpots2 = compileFile(negCustomArgs, "noimports2", List("-Yno-imports")) + @Test def neg_i2002 = compileFile(negCustomArgs, "i2002", Nil) @Test def run_all = runFiles(runDir) |