summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala1
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala3
2 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 685fe8b419..4b037533f6 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -843,7 +843,6 @@ trait Namers { self: Analyzer =>
// for instance, B.foo would not override A.foo, and the default on parameter b would not be inherited
// class A { def foo[T](a: T)(b: T = a) = a }
// class B extends A { override def foo[U](a: U)(b: U) = b }
- // (new B).foo(1)()
sym != NoSymbol && (site.memberType(sym) matches thisMethodType(resultPt).substSym(tparams map (_.symbol), tparamSyms))
})
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index d6bcd4f6eb..c19cedfe75 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1507,7 +1507,8 @@ trait Typers { self: Analyzer =>
checkStructuralCondition(meth.owner, vparam)
// only one overloaded method is allowed to have defaults
- if (meth.owner.isClass && meth.paramss.exists(_.exists(_.hasFlag(DEFAULTPARAM)))) {
+ if (phase.id <= currentRun.typerPhase.id &&
+ meth.owner.isClass && meth.paramss.exists(_.exists(_.hasFlag(DEFAULTPARAM)))) {
// don't do the check if it has already failed for another alternatvie
if (meth.paramss.exists(_.exists(p => p.hasFlag(DEFAULTPARAM) &&
!p.defaultGetter.tpe.isError))) {