Skip to content

Commit aeac2f6

Browse files
committed
Add test case
1 parent bfd085d commit aeac2f6

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/run/i8425.check

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
text: 22
2+
text: 65
3+
text: 10

tests/run/i8425.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import java.io.{ OutputStream, PrintStream }
2+
3+
trait T {
4+
val text: String
5+
val stream = new PrintStream(new OutputStream {
6+
def write(b: Int) = Console.println(s"text: $b")
7+
}) {
8+
override def println(x: Any) = ???
9+
}
10+
}
11+
12+
@main def Test =
13+
val t = new T { val text = "hello" }
14+
t.stream.write(22)
15+
t.stream.println('A')

0 commit comments

Comments
 (0)