diff options
author | Paul Phillips <paulp@improving.org> | 2013-04-14 10:24:33 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-04-14 10:24:33 -0700 |
commit | 4525e9223a2fb7c1ec3014073566b559e5839805 (patch) | |
tree | f4571715dca17a1ea6524a608600c9d17f70f59e /src | |
parent | 18509dc1137ff10c3c4d4b26c17ad32f51bbc403 (diff) | |
parent | 67c2d6df8141d77c7ac04aa6f97cbc6e53684473 (diff) | |
download | scala-4525e9223a2fb7c1ec3014073566b559e5839805.tar.gz scala-4525e9223a2fb7c1ec3014073566b559e5839805.tar.bz2 scala-4525e9223a2fb7c1ec3014073566b559e5839805.zip |
Merge pull request #2383 from vigdorchik/ticket/si-6286
SI-6286 IllegalArgumentException handling specialized method.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala index a71920f787..07b1cb4206 100644 --- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala +++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala @@ -976,27 +976,24 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { debuglog("specialized overload %s for %s in %s: %s".format(om, overriding.name.decode, pp(env), om.info)) typeEnv(om) = env addConcreteSpecMethod(overriding) - info(om) = ( - if (overriding.isDeferred) { // abstract override - debuglog("abstract override " + overriding.fullName + " with specialized " + om.fullName) - Forward(overriding) - } - else { - // if the override is a normalized member, 'om' gets the - // implementation from its original target, and adds the - // environment of the normalized member (that is, any - // specialized /method/ type parameter bindings) - val impl = info get overriding match { - case Some(NormalizedMember(target)) => - typeEnv(om) = env ++ typeEnv(overriding) - target - case _ => - overriding - } - info(overriding) = Forward(om setPos overriding.pos) - SpecialOverride(impl) + if (overriding.isDeferred) { // abstract override + debuglog("abstract override " + overriding.fullName + " with specialized " + om.fullName) + info(om) = Forward(overriding) + } + else { + // if the override is a normalized member, 'om' gets the + // implementation from its original target, and adds the + // environment of the normalized member (that is, any + // specialized /method/ type parameter bindings) + info get overriding match { + case Some(NormalizedMember(target)) => + typeEnv(om) = env ++ typeEnv(overriding) + info(om) = Forward(target) + case _ => + info(om) = SpecialOverride(overriding) } - ) + info(overriding) = Forward(om setPos overriding.pos) + } newOverload(overriding, om, env) ifDebug(afterSpecialize(assert( overridden.owner.info.decl(om.name) != NoSymbol, |