diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2012-01-17 15:23:02 +0100 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2012-01-17 15:25:28 +0100 |
commit | 1591c14e504246d2cb49b1f7f3e00f6d986f6a06 (patch) | |
tree | 30042b7fb7afcd0cd148d893f051571e39b4a90e /src/compiler | |
parent | cebc49b9f37ec8c8a3befcee6142f9c0590c41e2 (diff) | |
download | scala-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.scala | 5 |
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) |