Skip to content

Add regression tests for various open issues #5800

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
Jan 28, 2019
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
2 changes: 2 additions & 0 deletions compiler/test-resources/repl/i5345
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
scala> def x[A, B]: ImplicitConverter[A, B] = _ => ???
def x[A, B] => ImplicitConverter[A, B]
7 changes: 7 additions & 0 deletions compiler/test-resources/repl/i5733
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
scala> abstract class F { def f(arg: Any): Unit; override def toString = "F" }
// defined class F
scala> val f: F = println
1 | val f: F = println
| ^^^^^^^
|method println is eta-expanded even though F does not have the @FunctionalInterface annotation.
val f: F = F
2 changes: 2 additions & 0 deletions tests/neg/i2032.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class foo(annotation: Any)
@foo(new AnyRef {}) trait A // error: found: foo, required: scala.annotation.Annotation
2 changes: 2 additions & 0 deletions tests/neg/i3506.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trait C2[@specialized A] // error
class specialized extends C2[Char] // error
4 changes: 4 additions & 0 deletions tests/pos-java-interop/i2109/Annot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package foo;
import java.lang.annotation.*;

public @interface Annot {}
5 changes: 5 additions & 0 deletions tests/pos-java-interop/i2109/Foo.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Foo {
import foo.Annot

@Annot def bla = ()
}
9 changes: 9 additions & 0 deletions tests/pos/i2339.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import scala.collection.mutable

case class Foo[K, V]()(implicit conv: ImplicitConverter[V, Ordered[V]])
extends mutable.HashMap[K,V] {

val a = this.toSeq.sortWith { case ((_, v1), (_, v2)) => v1 > v2 }

val b = this.toSeq.sortWith(_._2 > _._2)
}
12 changes: 12 additions & 0 deletions tests/pos/i4316.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
object Test {

case class Bar[A]

def meth[A](consumer: A => Unit, s: Bar[A]): Unit = {
s match {
case bar: Bar[a] => {
meth(consumer, new Bar[a]) // ok with `meth[a]`
}
}
}
}
7 changes: 7 additions & 0 deletions tests/run/i1533.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
object Test {
def main(args: Array[String]): Unit = {
val x = (if (1 == 1) 1 else 2.0): Any
assert(x.isInstanceOf[java.lang.Integer])
assert(x == 1)
}
}