aboutsummaryrefslogtreecommitdiff
path: root/tests/disabled
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-08-23 15:48:48 +0200
committerMartin Odersky <odersky@gmail.com>2016-08-23 15:54:17 +0200
commit1a538af06323f7d6cd471ae0af39842f26e9e7be (patch)
treeec621d6d47aee7aaaec8c18f0697afdd118b999a /tests/disabled
parent76c3e99e33cf25a6ebccc0785212f629a3cda54e (diff)
downloaddotty-1a538af06323f7d6cd471ae0af39842f26e9e7be.tar.gz
dotty-1a538af06323f7d6cd471ae0af39842f26e9e7be.tar.bz2
dotty-1a538af06323f7d6cd471ae0af39842f26e9e7be.zip
Fix #1457: Three incompatbilities with scalac
Two of these are unavoidable. I moved the tests to diabled/not-representable and added in each case a comment to the main scala file detailing why there is a deviation. The last one (import-rewrite) is fixed.
Diffstat (limited to 'tests/disabled')
-rw-r--r--tests/disabled/not-representable/hkt/compiler.error6
-rw-r--r--tests/disabled/not-representable/hkt/hkt.scala18
-rw-r--r--tests/disabled/not-representable/naming-resolution/callsite.scala10
-rw-r--r--tests/disabled/not-representable/naming-resolution/compiler.error8
-rw-r--r--tests/disabled/not-representable/naming-resolution/package.scala5
5 files changed, 47 insertions, 0 deletions
diff --git a/tests/disabled/not-representable/hkt/compiler.error b/tests/disabled/not-representable/hkt/compiler.error
new file mode 100644
index 000000000..b31760891
--- /dev/null
+++ b/tests/disabled/not-representable/hkt/compiler.error
@@ -0,0 +1,6 @@
+$ scalac tests/pending/hkt/*.scala
+$ ./bin/dotc tests/pending/hkt/*.scala
+tests/pending/hkt/hkt.scala:14: error: method empty in object Child does not take type parameters
+ Child.empty[Int]
+ ^
+one error found
diff --git a/tests/disabled/not-representable/hkt/hkt.scala b/tests/disabled/not-representable/hkt/hkt.scala
new file mode 100644
index 000000000..1a9932d73
--- /dev/null
+++ b/tests/disabled/not-representable/hkt/hkt.scala
@@ -0,0 +1,18 @@
+// This one is unavoidable. Dotty does not allow several overloaded
+// parameterless methods, so it picks the one in the subclass.
+
+import scala.language.higherKinds
+// Minimal reproduction for:
+// scala.collection.mutable.ArrayStack.empty[Int]
+
+abstract class Super[C[_]] {
+ def empty[T]: C[T] = ???
+}
+
+class Child[T]
+
+object Child extends Super[Child] {
+ def empty: Child[Nothing] = new Child()
+
+ Child.empty[Int]
+}
diff --git a/tests/disabled/not-representable/naming-resolution/callsite.scala b/tests/disabled/not-representable/naming-resolution/callsite.scala
new file mode 100644
index 000000000..036803a26
--- /dev/null
+++ b/tests/disabled/not-representable/naming-resolution/callsite.scala
@@ -0,0 +1,10 @@
+// This one should be rejected according to spec. The import takes precedence
+// over the type in the same package because the typeis declared in a
+// different compilation unit. scalac does not conform to spec here.
+package naming.resolution
+
+import java.nio.file._ // Imports `Files`
+
+object Resolution {
+ def gimmeFiles: Files = Files.list(Paths.get("."))
+}
diff --git a/tests/disabled/not-representable/naming-resolution/compiler.error b/tests/disabled/not-representable/naming-resolution/compiler.error
new file mode 100644
index 000000000..81d6b3cfa
--- /dev/null
+++ b/tests/disabled/not-representable/naming-resolution/compiler.error
@@ -0,0 +1,8 @@
+$ scalac tests/pending/naming-resolution/*.scala
+$ ./bin/dotc tests/pending/naming-resolution/*.scala
+tests/pending/naming-resolution/callsite.scala:6: error: type mismatch:
+ found : java.util.stream.Stream[java.nio.file.Path]
+ required: java.nio.file.Files
+ def gimmeFiles: Files = Files.list(Paths.get("."))
+ ^
+one error found
diff --git a/tests/disabled/not-representable/naming-resolution/package.scala b/tests/disabled/not-representable/naming-resolution/package.scala
new file mode 100644
index 000000000..f0e26ee95
--- /dev/null
+++ b/tests/disabled/not-representable/naming-resolution/package.scala
@@ -0,0 +1,5 @@
+package naming
+
+package object resolution {
+ type Files = java.util.stream.Stream[java.nio.file.Path]
+}