diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2010-05-13 11:50:48 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2010-05-13 11:50:48 +0000 |
commit | a239e85e6552542a434e20b0749eb7c68f943de9 (patch) | |
tree | efe0f40ffe73f95bd529a36e2b36ab4843cb4a6a /src/compiler | |
parent | fa75d20c42b520eae0bf5b550fc4094a9cc895c5 (diff) | |
download | scala-a239e85e6552542a434e20b0749eb7c68f943de9.tar.gz scala-a239e85e6552542a434e20b0749eb7c68f943de9.tar.bz2 scala-a239e85e6552542a434e20b0749eb7c68f943de9.zip |
Closes #3433.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala index c624f85f5a..ceb390165e 100644 --- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala +++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala @@ -598,7 +598,15 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { private def normalizeMember(owner: Symbol, sym: Symbol, outerEnv: TypeEnv): List[Symbol] = { if (settings.debug.value) log("normalizeMember: " + sym.fullName) if (sym.isMethod && !atPhase(currentRun.typerPhase)(sym.typeParams.isEmpty)) { - val (stps, tps) = splitParams(sym.info.typeParams) + var (stps, tps) = splitParams(sym.info.typeParams) + val unusedStvars = stps -- specializedTypeVars(sym.info).toList + if (unusedStvars.nonEmpty && currentRun.compiles(sym)) { + reporter.warning(sym.pos, "%s %s unused or used in non-specializable positions." + .format(unusedStvars.mkString("", ", ", ""), if (unusedStvars.length == 1) "is" else "are")) + unusedStvars foreach (_.removeAnnotation(SpecializedClass)) + stps = stps -- unusedStvars + tps = tps ::: unusedStvars + } val res = sym :: (for (env <- specializations(stps) if needsSpecialization(env, sym)) yield { val keys = env.keysIterator.toList; val vals = env.valuesIterator.toList |