summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2012-01-17 15:23:02 +0100
committerIulian Dragos <jaguarul@gmail.com>2012-01-17 15:25:28 +0100
commit1591c14e504246d2cb49b1f7f3e00f6d986f6a06 (patch)
tree30042b7fb7afcd0cd148d893f051571e39b4a90e /src/compiler
parentcebc49b9f37ec8c8a3befcee6142f9c0590c41e2 (diff)
downloadscala-1591c14e504246d2cb49b1f7f3e00f6d986f6a06.tar.gz
scala-1591c14e504246d2cb49b1f7f3e00f6d986f6a06.tar.bz2
scala-1591c14e504246d2cb49b1f7f3e00f6d986f6a06.zip
Make specialization pick up opportunities when the
specialized method has additional (non-specialized) type parameters. This fix comes from Stefan's desire to specialize HLists (see corresponding test). review by @prokopec
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
index 5d13f80897..cf25ebe591 100644
--- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
+++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
@@ -1275,7 +1275,10 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
.format(tree, symbol.tpe, tree.tpe, env, specializedName(symbol, env)))
if (!env.isEmpty) { // a method?
val specCandidates = qual.tpe.member(specializedName(symbol, env))
- val specMember = specCandidates suchThat (s => doesConform(symbol, tree.tpe, s.tpe, env))
+ val specMember = specCandidates suchThat { s =>
+ doesConform(symbol, tree.tpe, qual.tpe.memberType(s), env)
+ }
+
log("[specSym] found: " + specCandidates.tpe + ", instantiated as: " + tree.tpe)
log("[specSym] found specMember: " + specMember)
if (specMember ne NoSymbol)