summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2011-05-03 10:28:01 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2011-05-03 10:28:01 +0000
commita895f35fe1692025c609b7a734e4efba856b7193 (patch)
tree29d01b30a69593fce8db1141ad161800c7bb2b93
parent2dee8cc7acfb433da5e7c416dcfb829e9949599d (diff)
downloadscala-a895f35fe1692025c609b7a734e4efba856b7193.tar.gz
scala-a895f35fe1692025c609b7a734e4efba856b7193.tar.bz2
scala-a895f35fe1692025c609b7a734e4efba856b7193.zip
Merged revisions 24873 via svnmerge from
https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk ........ r24873 | dragos | 2011-05-03 12:16:55 +0200 (Tue, 03 May 2011) | 1 line Fixes #4527. Bridge methods are now correctly loaded by the bytecode reader. No warnings when optimizing for-loops. review by extempore. ........
-rw-r--r--src/compiler/scala/tools/nsc/backend/opt/Inliners.scala9
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala6
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala4
3 files changed, 11 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala b/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
index 70e9f78974..4ac4864d43 100644
--- a/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
+++ b/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
@@ -236,9 +236,12 @@ abstract class Inliners extends SubComponent {
}
}
- private def isMonadicMethod(sym: Symbol) = sym.name match {
- case nme.foreach | nme.filter | nme.withFilter | nme.map | nme.flatMap => true
- case _ => false
+ private def isMonadicMethod(sym: Symbol) = {
+ val (origName, _, _) = nme.splitSpecializedName(sym.name)
+ origName match {
+ case nme.foreach | nme.filter | nme.withFilter | nme.map | nme.flatMap => true
+ case _ => false
+ }
}
private def isHigherOrderMethod(sym: Symbol) =
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index db2a06e255..08094d4104 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -246,14 +246,14 @@ abstract class ClassfileParser {
val origName = nme.originalName(name)
val owner = if (static) ownerTpe.typeSymbol.linkedClassOfClass else ownerTpe.typeSymbol
// println("\t" + owner.info.member(name).tpe.widen + " =:= " + tpe)
- f = owner.info.member(origName).suchThat(_.tpe.widen =:= tpe)
+ f = owner.info.findMember(origName, 0, 0, false).suchThat(_.tpe.widen =:= tpe)
if (f == NoSymbol)
- f = owner.info.member(newTermName(origName + nme.LOCAL_SUFFIX_STRING)).suchThat(_.tpe =:= tpe)
+ f = owner.info.findMember(newTermName(origName + nme.LOCAL_SUFFIX_STRING), 0, 0, false).suchThat(_.tpe =:= tpe)
if (f == NoSymbol) {
// if it's an impl class, try to find it's static member inside the class
if (ownerTpe.typeSymbol.isImplClass) {
// println("impl class, member: " + owner.tpe.member(origName) + ": " + owner.tpe.member(origName).tpe)
- f = ownerTpe.member(origName).suchThat(_.tpe =:= tpe)
+ f = ownerTpe.findMember(origName, 0, 0, false).suchThat(_.tpe =:= tpe)
} else {
log("Couldn't find " + name + ": " + tpe + " inside: \n" + ownerTpe)
f = if (tpe.isInstanceOf[MethodType]) owner.newMethod(owner.pos, name).setInfo(tpe)
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
index 8ae305cc25..ac2cd9e996 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
@@ -101,9 +101,9 @@ abstract class ICodeReader extends ClassfileParser {
(jflags, NoSymbol)
else {
val owner = getOwner(jflags)
- var sym = owner.info.member(name).suchThat(old => sameType(old.tpe, tpe));
+ var sym = owner.info.findMember(name, 0, 0, false).suchThat(old => sameType(old.tpe, tpe));
if (sym == NoSymbol)
- sym = owner.info.member(newTermName(name + nme.LOCAL_SUFFIX_STRING)).suchThat(old => old.tpe =:= tpe);
+ sym = owner.info.findMember(newTermName(name + nme.LOCAL_SUFFIX_STRING), 0, 0, false).suchThat(old => old.tpe =:= tpe);
if (sym == NoSymbol) {
log("Could not find symbol for " + name + ": " + tpe)
log(owner.info.member(name).tpe + " : " + tpe)