From 233b8096359875d4b6432fbe5988724652b85752 Mon Sep 17 00:00:00 2001 From: Ólafur Páll Geirsson Date: Fri, 5 Aug 2016 11:28:00 +0200 Subject: Three incompatibilities with scalac. Using Scala 2.11.8 and dotty at bcfa3be8cfe2be. cc/ #1457 --- tests/pending/hkt/compiler.error | 6 ++++++ tests/pending/hkt/hkt.scala | 15 +++++++++++++++ tests/pending/import-rewrite/compiler.error | 6 ++++++ tests/pending/import-rewrite/file.scala | 10 ++++++++++ tests/pending/import-rewrite/rewrite.scala | 7 +++++++ tests/pending/naming-resolution/callsite.scala | 7 +++++++ tests/pending/naming-resolution/compiler.error | 8 ++++++++ tests/pending/naming-resolution/package.scala | 5 +++++ 8 files changed, 64 insertions(+) create mode 100644 tests/pending/hkt/compiler.error create mode 100644 tests/pending/hkt/hkt.scala create mode 100644 tests/pending/import-rewrite/compiler.error create mode 100644 tests/pending/import-rewrite/file.scala create mode 100644 tests/pending/import-rewrite/rewrite.scala create mode 100644 tests/pending/naming-resolution/callsite.scala create mode 100644 tests/pending/naming-resolution/compiler.error create mode 100644 tests/pending/naming-resolution/package.scala (limited to 'tests/pending') 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] +} -- cgit v1.2.3