From 1a538af06323f7d6cd471ae0af39842f26e9e7be Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 23 Aug 2016 15:48:48 +0200 Subject: 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. --- tests/pos/import-rewrite/file.scala | 10 ++++++++++ tests/pos/import-rewrite/rewrite.scala | 7 +++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/pos/import-rewrite/file.scala create mode 100644 tests/pos/import-rewrite/rewrite.scala (limited to 'tests/pos/import-rewrite') diff --git a/tests/pos/import-rewrite/file.scala b/tests/pos/import-rewrite/file.scala new file mode 100644 index 000000000..e52581e81 --- /dev/null +++ b/tests/pos/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/pos/import-rewrite/rewrite.scala b/tests/pos/import-rewrite/rewrite.scala new file mode 100644 index 000000000..0bda02c5e --- /dev/null +++ b/tests/pos/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 +} -- cgit v1.2.3