diff options
author | Martin Odersky <odersky@gmail.com> | 2005-12-15 10:17:12 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2005-12-15 10:17:12 +0000 |
commit | 62df5b4f60baad2032935efdc2266d4825b7c863 (patch) | |
tree | d973fafc89fe26d190e9d5bae789a2d63101d53a /sources | |
parent | b68121ff0e8037e49455634b20c3c5d56b4df91a (diff) | |
download | scala-62df5b4f60baad2032935efdc2266d4825b7c863.tar.gz scala-62df5b4f60baad2032935efdc2266d4825b7c863.tar.bz2 scala-62df5b4f60baad2032935efdc2266d4825b7c863.zip |
Diffstat (limited to 'sources')
-rwxr-xr-x | sources/scala/tools/nsc/symtab/Names.scala | 3 | ||||
-rwxr-xr-x | sources/scala/tools/nsc/typechecker/Typers.scala | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/sources/scala/tools/nsc/symtab/Names.scala b/sources/scala/tools/nsc/symtab/Names.scala index 8ee2272aa7..88d2d192cf 100755 --- a/sources/scala/tools/nsc/symtab/Names.scala +++ b/sources/scala/tools/nsc/symtab/Names.scala @@ -73,8 +73,9 @@ class Names { def newTermName(cs: Array[char], offset: int, len: int): Name = { val h = hashValue(cs, offset, len) & HASH_MASK; var n = termHashtable(h); - while ((n != null) && (n.length != len || !equals(n.start, cs, offset, len))) + while ((n != null) && (n.length != len || !equals(n.start, cs, offset, len))) { n = n.next; + } if (n == null) { n = new TermName(nc, len, h); enterChars(cs, offset, len); diff --git a/sources/scala/tools/nsc/typechecker/Typers.scala b/sources/scala/tools/nsc/typechecker/Typers.scala index 1d58570f4f..7cfa781624 100755 --- a/sources/scala/tools/nsc/typechecker/Typers.scala +++ b/sources/scala/tools/nsc/typechecker/Typers.scala @@ -49,7 +49,12 @@ import collection.mutable.HashMap; private def inferView(pos: int, from: Type, to: Type, reportAmbiguous: boolean): Tree = { if (settings.debug.value) log("infer view from " + from + " to " + to);//debug if (phase.erasedTypes) EmptyTree - else inferImplicit(pos, functionType(List(from), to), true, reportAmbiguous); + else from match { + case MethodType(_, _) => EmptyTree + case OverloadedType(_, _) => EmptyTree + case PolyType(_, _) => EmptyTree + case _ => inferImplicit(pos, functionType(List(from), to), true, reportAmbiguous) + } } private def inferView(pos: int, from: Type, name: Name, reportAmbiguous: boolean): Tree = { @@ -369,6 +374,7 @@ import collection.mutable.HashMap; case _ => TypeTree(tree.tpe) setOriginal(tree) } } else if ((mode & (EXPRmode | FUNmode)) == (EXPRmode | FUNmode) && + !tree.tpe.isInstanceOf[MethodType] && !tree.tpe.isInstanceOf[OverloadedType] && ((mode & TAPPmode) == 0 || tree.tpe.typeParams.isEmpty) && adaptToName(tree, nme.apply).tpe.nonLocalMember(nme.apply) .filter(m => m.tpe.paramSectionCount > 0) != NoSymbol) { // (8) |