diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-11-09 18:30:23 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-11-18 11:14:37 +1000 |
commit | a77f01f546312cf6601f03794f909a09d34c5445 (patch) | |
tree | dcf3859e10c4bf8d53052222bfb7fff1c23be253 /test/files/neg | |
parent | 90a98f7c41cfcfdb60dc25db5ac33d0d0ff10f99 (diff) | |
download | scala-a77f01f546312cf6601f03794f909a09d34c5445.tar.gz scala-a77f01f546312cf6601f03794f909a09d34c5445.tar.bz2 scala-a77f01f546312cf6601f03794f909a09d34c5445.zip |
SI-5639 Predicate bug fix on -Xsource:2.12
To be conservative, I've predicated this fix in `-Xsource:2.12`.
This is done in separate commit to show that the previous fix
passes the test suite, rather than just tests with `-Xsource:2.12`.
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t5639b.check | 4 | ||||
-rw-r--r-- | test/files/neg/t5639b/A_1.scala | 17 | ||||
-rw-r--r-- | test/files/neg/t5639b/A_2.scala | 11 |
3 files changed, 32 insertions, 0 deletions
diff --git a/test/files/neg/t5639b.check b/test/files/neg/t5639b.check new file mode 100644 index 0000000000..faa1766660 --- /dev/null +++ b/test/files/neg/t5639b.check @@ -0,0 +1,4 @@ +A_2.scala:6: error: could not find implicit value for parameter e: Int + implicitly[Int] + ^ +one error found diff --git a/test/files/neg/t5639b/A_1.scala b/test/files/neg/t5639b/A_1.scala new file mode 100644 index 0000000000..c5da10eae4 --- /dev/null +++ b/test/files/neg/t5639b/A_1.scala @@ -0,0 +1,17 @@ +import Implicits._ + +class Baz + +object Test { + implicitly[Int] +} + +object Implicits { + implicit val Baz: Int = 0 + // This implicit was being ignored by `isQualifyingImplicit` + // if the classpath contained a class file for `class Baz`. + // This is because the package scope contains a speculative + // symbol for `object Baz` which is entered by `SymbolLoaders` + // before looking inside the class file. (A Java originated + // classfile results in the class/module symbol pair.) +} diff --git a/test/files/neg/t5639b/A_2.scala b/test/files/neg/t5639b/A_2.scala new file mode 100644 index 0000000000..2bb36273e0 --- /dev/null +++ b/test/files/neg/t5639b/A_2.scala @@ -0,0 +1,11 @@ +import Implicits._ + +class Baz + +object Test { + implicitly[Int] +} + +object Implicits { + implicit val Baz: Int = 0 +} |