diff options
author | odersky <odersky@gmail.com> | 2016-07-18 13:04:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-18 13:04:17 +0200 |
commit | a307a90c1a5f498087612894c3a923a299d02a66 (patch) | |
tree | 04658afa9c262f0be0d690290dae38ed72c325a3 /tests/neg | |
parent | 9da40cb84d613bcea3a0e0890b2e53129fe60bc6 (diff) | |
parent | 762375cb41c23fc912dd9c9e1cc273b706a65631 (diff) | |
download | dotty-a307a90c1a5f498087612894c3a923a299d02a66.tar.gz dotty-a307a90c1a5f498087612894c3a923a299d02a66.tar.bz2 dotty-a307a90c1a5f498087612894c3a923a299d02a66.zip |
Merge pull request #1389 from dotty-staging/fix-#1381
Changes to overloading
Diffstat (limited to 'tests/neg')
-rw-r--r-- | tests/neg/t2660.scala | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/tests/neg/t2660.scala b/tests/neg/t2660.scala deleted file mode 100644 index 17fe26258..000000000 --- a/tests/neg/t2660.scala +++ /dev/null @@ -1,47 +0,0 @@ -// Dotty deviation. The calls here now are classified as ambiguous. - -package hoho - -class G - -class H extends G - -class A[T](x: T) { - - def this(y: G, z: T) = { - this(z) - print(1) - } - - def this(z: H, h: T) = { - this(h) - print(2) - } -} - -object T { - def main(args: Array[String]): Unit = { - implicit def g2h(g: G): H = new H - new A[Int](new H, 23) // error - // in the context here, either secondary constructor is applicable - // to the other, due to the implicit in scope. So the call is ambiguous. - } -} - - -// A version of t2660 which does not use constructors - -object X { - def f[T](x: T) = ??? - def f[T](y: G, z: T) = ??? - def f[T](z: H, h: T) = ??? -} - -object T2 { - def main(args: Array[String]): Unit = { - implicit def g2h(g: G): H = new H - X.f(new H, 23) // error - } -} - - |