diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-12-13 10:10:26 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-12-13 10:10:26 -0800 |
commit | 4371969ddca5c8711f4b973f84db5062d6103760 (patch) | |
tree | cd94014d3dfc33828a6552e286ccf2d1091246b8 /test/files | |
parent | 1e530365fd3a1ab749091e7c56850405dc98aed1 (diff) | |
parent | 110fde017ee32b7387393dad9b859fd89e900650 (diff) | |
download | scala-4371969ddca5c8711f4b973f84db5062d6103760.tar.gz scala-4371969ddca5c8711f4b973f84db5062d6103760.tar.bz2 scala-4371969ddca5c8711f4b973f84db5062d6103760.zip |
Merge pull request #3263 from retronym/ticket/6780
SI-6780 Better handling of cycles in in-scope implicit search
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/t712.check | 1 | ||||
-rw-r--r-- | test/files/pos/t6780.scala | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/test/files/neg/t712.check b/test/files/neg/t712.check index 6819dc0ce9..831e943063 100644 --- a/test/files/neg/t712.check +++ b/test/files/neg/t712.check @@ -1,4 +1,5 @@ t712.scala:10: error: value self is not a member of B.this.ParentImpl + Note: implicit method coerce is not applicable here because it comes after the application point and it lacks an explicit result type implicit def coerce(p : ParentImpl) = p.self; ^ one error found diff --git a/test/files/pos/t6780.scala b/test/files/pos/t6780.scala new file mode 100644 index 0000000000..4a358046c6 --- /dev/null +++ b/test/files/pos/t6780.scala @@ -0,0 +1,20 @@ +object O { + implicit def i: Int = 0 +} + +import O._ + +trait Foo { + implicit val v1: Any + implicit def d1: Any + val v2: Any + implicit val v3: Any +} + +trait Bar1 extends Foo { + implicit val v1 = {implicitly[Int]; ()} // failed due to cycle in Context#implicits being broken with Nil. + def d1 = {implicitly[Int]; ()} // okay + implicit val v2 = {implicitly[Int]; ()} // okay + implicit val v3: Any = {implicitly[Int]; ()} // okay + +} |