diff options
author | Ólafur Páll Geirsson <olafurpg@gmail.com> | 2016-08-05 11:28:00 +0200 |
---|---|---|
committer | Ólafur Páll Geirsson <olafurpg@gmail.com> | 2016-08-23 12:15:15 +0200 |
commit | 233b8096359875d4b6432fbe5988724652b85752 (patch) | |
tree | b55ba62af6dfd22b3c094db40b94c1f45a59e096 | |
parent | bcfa3be8cfe2be5d79d0147e6c8fde2c38717623 (diff) | |
download | dotty-233b8096359875d4b6432fbe5988724652b85752.tar.gz dotty-233b8096359875d4b6432fbe5988724652b85752.tar.bz2 dotty-233b8096359875d4b6432fbe5988724652b85752.zip |
Three incompatibilities with scalac.
Using Scala 2.11.8 and dotty at bcfa3be8cfe2be.
cc/ #1457
-rw-r--r-- | tests/pending/hkt/compiler.error | 6 | ||||
-rw-r--r-- | tests/pending/hkt/hkt.scala | 15 | ||||
-rw-r--r-- | tests/pending/import-rewrite/compiler.error | 6 | ||||
-rw-r--r-- | tests/pending/import-rewrite/file.scala | 10 | ||||
-rw-r--r-- | tests/pending/import-rewrite/rewrite.scala | 7 | ||||
-rw-r--r-- | tests/pending/naming-resolution/callsite.scala | 7 | ||||
-rw-r--r-- | tests/pending/naming-resolution/compiler.error | 8 | ||||
-rw-r--r-- | tests/pending/naming-resolution/package.scala | 5 |
8 files changed, 64 insertions, 0 deletions
diff --git a/tests/pending/hkt/compiler.error b/tests/pending/hkt/compiler.error new file mode 100644 index 000000000..b31760891 --- /dev/null +++ b/tests/pending/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/pending/hkt/hkt.scala b/tests/pending/hkt/hkt.scala new file mode 100644 index 000000000..34858cd95 --- /dev/null +++ b/tests/pending/hkt/hkt.scala @@ -0,0 +1,15 @@ +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/pending/import-rewrite/compiler.error b/tests/pending/import-rewrite/compiler.error new file mode 100644 index 000000000..0832d33bb --- /dev/null +++ b/tests/pending/import-rewrite/compiler.error @@ -0,0 +1,6 @@ +$ scalac tests/pending/import-rewrite/*.scala +$ ./bin/dotc tests/pending/import-rewrite/*.scala +tests/pending/import-rewrite/rewrite.scala:5: error: value apply is not a member of java.io.File.type + Seq("").map(File.apply) + ^ +one error found diff --git a/tests/pending/import-rewrite/file.scala b/tests/pending/import-rewrite/file.scala new file mode 100644 index 000000000..e52581e81 --- /dev/null +++ b/tests/pending/import-rewrite/file.scala @@ -0,0 +1,10 @@ +package file + +class File private (val str: String) { + def name: String = "name" +} + +object File { + def apply(str: String): File = new File(str) +} + diff --git a/tests/pending/import-rewrite/rewrite.scala b/tests/pending/import-rewrite/rewrite.scala new file mode 100644 index 000000000..0bda02c5e --- /dev/null +++ b/tests/pending/import-rewrite/rewrite.scala @@ -0,0 +1,7 @@ +package file +import java.io.{File => JFile, _}, StreamTokenizer.{TT_EOF => eof} + +object Main { + Seq("").map(File.apply) + // def name(file: File) = file.name +} diff --git a/tests/pending/naming-resolution/callsite.scala b/tests/pending/naming-resolution/callsite.scala new file mode 100644 index 000000000..b6f2000c9 --- /dev/null +++ b/tests/pending/naming-resolution/callsite.scala @@ -0,0 +1,7 @@ +package naming.resolution + +import java.nio.file._ // Imports `Files` + +object Resolution { + def gimmeFiles: Files = Files.list(Paths.get(".")) +} diff --git a/tests/pending/naming-resolution/compiler.error b/tests/pending/naming-resolution/compiler.error new file mode 100644 index 000000000..81d6b3cfa --- /dev/null +++ b/tests/pending/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/pending/naming-resolution/package.scala b/tests/pending/naming-resolution/package.scala new file mode 100644 index 000000000..f0e26ee95 --- /dev/null +++ b/tests/pending/naming-resolution/package.scala @@ -0,0 +1,5 @@ +package naming + +package object resolution { + type Files = java.util.stream.Stream[java.nio.file.Path] +} |