aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/i2033.scala
blob: b28a0d99e5be313b974bf5d694a8337bf2b740b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import java.io._
import collection._
object Test {
  def check(obj: AnyRef): Unit = {
    val bos = new ByteArrayOutputStream()
    val out = new ObjectOutputStream(println) // error
    val arr = bos toByteArray ()
    val in = (())
    val deser = ()
    val lhs = mutable LinkedHashSet ()
    check(lhs)
  }
}

// minimization
object Test2 {
  class ObjectOutputStream(out: String) {
    def this() = this("")
  }
  val out = new ObjectOutputStream(println) // error
}