diff options
Diffstat (limited to 'src/compiler')
3 files changed, 19 insertions, 19 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala index 07b1cb4206..39716d4ed0 100644 --- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala +++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala @@ -796,7 +796,11 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { private def normalizeMember(owner: Symbol, sym: Symbol, outerEnv: TypeEnv): List[Symbol] = { sym :: ( if (!sym.isMethod || beforeTyper(sym.typeParams.isEmpty)) Nil - else { + else if (sym.hasDefault) { + /* Specializing default getters is useless, also see SI-7329 . */ + sym.resetFlag(SPECIALIZED) + Nil + } else { // debuglog("normalizeMember: " + sym.fullNameAsName('.').decode) var specializingOn = specializedParams(sym) val unusedStvars = specializingOn filterNot specializedTypeVars(sym.info) diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index f2a2ef4d61..6c2945cad3 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -84,6 +84,8 @@ trait Contexts { self: Analyzer => case Import(qual, _) => qual.tpe = singleType(qual.symbol.owner.thisType, qual.symbol) case _ => } + sc.flushAndReturnBuffer() + sc.flushAndReturnWarningsBuffer() sc = sc.outer } } diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 33f60d6676..8cfb975a54 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -507,10 +507,7 @@ trait Typers extends Modes with Adaptations with Tags { @inline final def typerReportAnyContextErrors[T](c: Context)(f: Typer => T): T = { - val res = f(newTyper(c)) - if (c.hasErrors) - context.issue(c.errBuffer.head) - res + f(newTyper(c)) } @inline @@ -1747,9 +1744,7 @@ trait Typers extends Modes with Adaptations with Tags { assert(clazz != NoSymbol, cdef) reenterTypeParams(cdef.tparams) val tparams1 = cdef.tparams mapConserve (typedTypeDef) - val impl1 = typerReportAnyContextErrors(context.make(cdef.impl, clazz, newScope)) { - _.typedTemplate(cdef.impl, parentTypes(cdef.impl)) - } + val impl1 = newTyper(context.make(cdef.impl, clazz, newScope)).typedTemplate(cdef.impl, parentTypes(cdef.impl)) val impl2 = finishMethodSynthesis(impl1, clazz, context) if (clazz.isTrait && clazz.info.parents.nonEmpty && clazz.info.firstParent.typeSymbol == AnyClass) checkEphemeral(clazz, impl2.body) @@ -1790,17 +1785,16 @@ trait Typers extends Modes with Adaptations with Tags { || !linkedClass.isSerializable || clazz.isSerializable ) - val impl1 = typerReportAnyContextErrors(context.make(mdef.impl, clazz, newScope)) { - _.typedTemplate(mdef.impl, { - parentTypes(mdef.impl) ++ ( - if (noSerializable) Nil - else { - clazz.makeSerializable() - List(TypeTree(SerializableClass.tpe) setPos clazz.pos.focus) - } - ) - }) - } + val impl1 = newTyper(context.make(mdef.impl, clazz, newScope)).typedTemplate(mdef.impl, { + parentTypes(mdef.impl) ++ ( + if (noSerializable) Nil + else { + clazz.makeSerializable() + List(TypeTree(SerializableClass.tpe) setPos clazz.pos.focus) + } + ) + }) + val impl2 = finishMethodSynthesis(impl1, clazz, context) // SI-5954. On second compile of a companion class contained in a package object we end up |