diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-09-01 11:19:47 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-09-01 11:19:47 +0200 |
commit | 445c2f85e1ad0e4036c93949a72902173b5fdd56 (patch) | |
tree | b48a254b386dfb48ac1964f13a8fc85dd36c4df6 /test/files/neg | |
parent | 78401c8220fb56ed077b99a5ffb4205c14fee736 (diff) | |
download | scala-445c2f85e1ad0e4036c93949a72902173b5fdd56.tar.gz scala-445c2f85e1ad0e4036c93949a72902173b5fdd56.tar.bz2 scala-445c2f85e1ad0e4036c93949a72902173b5fdd56.zip |
More useful -Xlog-implicits output.
The test exercises the most important case, when implicits are invalidated through shadowing.
(See SI-4270)
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/implicit-shadow.check | 11 | ||||
-rw-r--r-- | test/files/neg/implicit-shadow.flags | 1 | ||||
-rw-r--r-- | test/files/neg/implicit-shadow.scala | 13 |
3 files changed, 25 insertions, 0 deletions
diff --git a/test/files/neg/implicit-shadow.check b/test/files/neg/implicit-shadow.check new file mode 100644 index 0000000000..042fca867a --- /dev/null +++ b/test/files/neg/implicit-shadow.check @@ -0,0 +1,11 @@ +implicit-shadow.scala:4: <i2s: error> is not a valid implicit value for Int(1) => ?{def isEmpty: ?} because: +reference to i2s is ambiguous; +it is imported twice in the same scope by +import C._ +and import B._ + 1.isEmpty + ^ +implicit-shadow.scala:4: error: value isEmpty is not a member of Int + 1.isEmpty + ^ +one error found diff --git a/test/files/neg/implicit-shadow.flags b/test/files/neg/implicit-shadow.flags new file mode 100644 index 0000000000..44842a9d65 --- /dev/null +++ b/test/files/neg/implicit-shadow.flags @@ -0,0 +1 @@ +-Xlog-implicits diff --git a/test/files/neg/implicit-shadow.scala b/test/files/neg/implicit-shadow.scala new file mode 100644 index 0000000000..ffd34b6408 --- /dev/null +++ b/test/files/neg/implicit-shadow.scala @@ -0,0 +1,13 @@ +object Test { + import B._, C._ + + 1.isEmpty +} + +trait A { + implicit def i2s(i: Int): String = "" +} + +object B extends A + +object C extends A
\ No newline at end of file |