Skip to content

Three incompatibilities with scalac. #1464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/pending/hkt/compiler.error
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions tests/pending/hkt/hkt.scala
Original file line number Diff line number Diff line change
@@ -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]
}
6 changes: 6 additions & 0 deletions tests/pending/import-rewrite/compiler.error
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions tests/pending/import-rewrite/file.scala
Original file line number Diff line number Diff line change
@@ -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)
}

7 changes: 7 additions & 0 deletions tests/pending/import-rewrite/rewrite.scala
Original file line number Diff line number Diff line change
@@ -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
}
7 changes: 7 additions & 0 deletions tests/pending/naming-resolution/callsite.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package naming.resolution

import java.nio.file._ // Imports `Files`

object Resolution {
def gimmeFiles: Files = Files.list(Paths.get("."))
}
8 changes: 8 additions & 0 deletions tests/pending/naming-resolution/compiler.error
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions tests/pending/naming-resolution/package.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package naming

package object resolution {
type Files = java.util.stream.Stream[java.nio.file.Path]
}