diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-10-21 04:19:08 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-10-21 04:19:08 +1000 |
commit | bb05881595f5734855bba8f419706d26da9563c7 (patch) | |
tree | 003d2c5ecc49c8061151479abd06e7e8f42651c3 /test/files/neg/t9527b.check | |
parent | c99e53e8a05fc5d45f8e8a28da68d3977be65bfa (diff) | |
download | scala-bb05881595f5734855bba8f419706d26da9563c7.tar.gz scala-bb05881595f5734855bba8f419706d26da9563c7.tar.bz2 scala-bb05881595f5734855bba8f419706d26da9563c7.zip |
SI-9527 Fix NPE in ambiguous implicit error generation
In #4673, an annotation was added to allow customization of the
compiler error for ambigous implicits. This change had incorrect
assumptions about the shape of trees that would be generated during
implicit search, and failed to account for the results of eta expanded
methods when searching for a function type.
This commit:
- Uses the symbol from `ImpilcitInfo`, rather than calling
`Tree#symbol` which is fraught with the danger of returning a
null symbol for something other than an application.
- Adds a test for customized messages for a polymorphic, eta
expanded method, and generalizes `treeTypeArgs` to handle the
implicit tree of shape `{ (x: X) => f[A](x)}`.
Diffstat (limited to 'test/files/neg/t9527b.check')
-rw-r--r-- | test/files/neg/t9527b.check | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/files/neg/t9527b.check b/test/files/neg/t9527b.check new file mode 100644 index 0000000000..4529ec83ea --- /dev/null +++ b/test/files/neg/t9527b.check @@ -0,0 +1,4 @@ +t9527b.scala:6: error: msg A=Nothing + implicitly[Int => String] + ^ +one error found |