summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSeth Tisue <seth@tisue.net>2015-10-27 08:48:46 -0400
committerSeth Tisue <seth@tisue.net>2015-10-27 08:48:46 -0400
commited2d7a1f3f776a3e49f66f3f0c7a4a3eb49f1443 (patch)
tree4d2167a7f2848cd9d16f22d82324e38f053db7e6 /src
parentd790277ee4a73ff09efb599fde88d3e408b239de (diff)
parentbb05881595f5734855bba8f419706d26da9563c7 (diff)
downloadscala-ed2d7a1f3f776a3e49f66f3f0c7a4a3eb49f1443.tar.gz
scala-ed2d7a1f3f776a3e49f66f3f0c7a4a3eb49f1443.tar.bz2
scala-ed2d7a1f3f776a3e49f66f3f0c7a4a3eb49f1443.zip
Merge pull request #4808 from retronym/ticket/9527
SI-9527 Fix NPE in ambiguous implicit error generation
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
index c9d3b3da96..b7c72f5373 100644
--- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
@@ -1250,13 +1250,14 @@ trait ContextErrors {
)
}
- def treeTypeArgs(annotatedTree: Tree) = annotatedTree match {
+ def treeTypeArgs(annotatedTree: Tree): List[String] = annotatedTree match {
case TypeApply(_, args) => args.map(_.toString)
+ case Block(_, Function(_, treeInfo.Applied(_, targs, _))) => targs.map(_.toString) // eta expansion, see neg/t9527b.scala
case _ => Nil
}
context.issueAmbiguousError(AmbiguousImplicitTypeError(tree,
- (tree1.symbol, tree2.symbol) match {
+ (info1.sym, info2.sym) match {
case (ImplicitAmbiguousMsg(msg), _) => msg.format(treeTypeArgs(tree1))
case (_, ImplicitAmbiguousMsg(msg)) => msg.format(treeTypeArgs(tree2))
case (_, _) if isView => viewMsg