diff options
author | Seth Tisue <seth@tisue.net> | 2015-10-27 08:48:46 -0400 |
---|---|---|
committer | Seth Tisue <seth@tisue.net> | 2015-10-27 08:48:46 -0400 |
commit | ed2d7a1f3f776a3e49f66f3f0c7a4a3eb49f1443 (patch) | |
tree | 4d2167a7f2848cd9d16f22d82324e38f053db7e6 /src | |
parent | d790277ee4a73ff09efb599fde88d3e408b239de (diff) | |
parent | bb05881595f5734855bba8f419706d26da9563c7 (diff) | |
download | scala-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.scala | 5 |
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 |