diff options
author | Martin Odersky <odersky@gmail.com> | 2007-12-19 13:21:09 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2007-12-19 13:21:09 +0000 |
commit | 422a46993cdb74ccf3650e0b171f65c6c12bdedf (patch) | |
tree | fcd3449613e8c47a8196212004fc60fa3153cb9d /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | 7d3efa0e191d805d171961b26baab773669b2b69 (diff) | |
download | scala-422a46993cdb74ccf3650e0b171f65c6c12bdedf.tar.gz scala-422a46993cdb74ccf3650e0b171f65c6c12bdedf.tar.bz2 scala-422a46993cdb74ccf3650e0b171f65c6c12bdedf.zip |
-target 1.5 now the default.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index a42a7fbb6d..4543111fba 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3341,22 +3341,23 @@ trait Typers { self: Analyzer => val tc = newTyper(context.makeImplicit(reportAmbiguous)) def ambiguousImplicitError(info1: ImplicitInfo, info2: ImplicitInfo, - pre1: String, pre2: String, trailer: String) = { - val coreMsg = - pre1+" "+info1.sym+info1.sym.locationString+" of type "+info1.tpe+"\n "+ - pre2+" "+info2.sym+info2.sym.locationString+" of type "+info2.tpe+"\n "+ - trailer - error(pos, - if (isView) { - val found = pt.typeArgs(0) - val req = pt.typeArgs(1) - typeErrorMsg(found, req)+ - "\nNote that implicit conversions are not applicable because they are ambiguous:\n "+ - coreMsg+"are possible conversion functions from "+ found+" to "+req - } else { - "ambiguous implicit values:\n "+coreMsg + "match expected type "+pt - }) - } + pre1: String, pre2: String, trailer: String) = + if (!info1.tpe.isErroneous && !info2.tpe.isErroneous) { + val coreMsg = + pre1+" "+info1.sym+info1.sym.locationString+" of type "+info1.tpe+"\n "+ + pre2+" "+info2.sym+info2.sym.locationString+" of type "+info2.tpe+"\n "+ + trailer + error(pos, + if (isView) { + val found = pt.typeArgs(0) + val req = pt.typeArgs(1) + typeErrorMsg(found, req)+ + "\nNote that implicit conversions are not applicable because they are ambiguous:\n "+ + coreMsg+"are possible conversion functions from "+ found+" to "+req + } else { + "ambiguous implicit values:\n "+coreMsg + "match expected type "+pt + }) + } /** Search list of implicit info lists for one matching prototype * <code>pt</code>. If found return a tree from found implicit info |