diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-04-02 17:17:11 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-04-02 17:17:11 +0200 |
commit | 1b21784e74e963be553a68a8923db9c501bc5355 (patch) | |
tree | 372830ffcc06c4391ec2b4a1c35cb8893cc2497e /test | |
parent | 8489be16b57a08f51bf3655c99cede52477b3022 (diff) | |
parent | afccae640cbfdd876e0eb3369570954d82adf508 (diff) | |
download | scala-1b21784e74e963be553a68a8923db9c501bc5355.tar.gz scala-1b21784e74e963be553a68a8923db9c501bc5355.tar.bz2 scala-1b21784e74e963be553a68a8923db9c501bc5355.zip |
Merge pull request #3669 from adriaanm/rebase-3667
SI-8460 Fix regression in implicit divergence recovery
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/divergent-implicit.check | 6 | ||||
-rw-r--r-- | test/files/pos/t8460.scala | 25 |
2 files changed, 30 insertions, 1 deletions
diff --git a/test/files/neg/divergent-implicit.check b/test/files/neg/divergent-implicit.check index 60d876409f..d4a3ddfc71 100644 --- a/test/files/neg/divergent-implicit.check +++ b/test/files/neg/divergent-implicit.check @@ -3,6 +3,10 @@ divergent-implicit.scala:4: error: type mismatch; required: String val x1: String = 1 ^ +divergent-implicit.scala:5: error: diverging implicit expansion for type Int => String +starting with method $conforms in object Predef + val x2: String = cast[Int, String](1) + ^ divergent-implicit.scala:14: error: type mismatch; found : Test2.Foo required: Test2.Bar @@ -13,4 +17,4 @@ divergent-implicit.scala:15: error: type mismatch; required: Test2.Bar val y: Bar = new Baz ^ -three errors found +four errors found diff --git a/test/files/pos/t8460.scala b/test/files/pos/t8460.scala new file mode 100644 index 0000000000..10d2ed432c --- /dev/null +++ b/test/files/pos/t8460.scala @@ -0,0 +1,25 @@ +object tan extends UFunc { + implicit def ImplDouble: Impl[Double, Double] = ??? +} + +trait UFunc { + trait TC[+A] + type Impl[V, VR] = UFunc.UImpl[this.type, V, VR] +} + +object UFunc { + class UImpl[A, B, C] + implicit def implicitDoubleUTag[Tag, V, VR](implicit conv: V=>Double, impl: UImpl[Tag, Double, VR]):UImpl[Tag, V, VR] = ??? + +} + +object Test { + implicitly[tan.Impl[Double, Double]] + // we should discard the one and only divergent implicit (`implicitDoubleUTag`) + // This is done under `scalac-hash v2.10.4 test.scala`, but not under + // `scalac-hash v2.10.4 -Xdivergence211 test.scala` + // + // This seems to be because the companion implicits contain redundant entries + // + +} |