Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit 1cd9f5b

Browse files
author
Adriaan Moors
committed
Merge pull request scala#590 from retronym/ticket/3899
Pending test for SI-3899.
2 parents 4b01e1f + 4613ae7 commit 1cd9f5b

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

test/pending/run/t3899.check

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
a,b
2+
a,b
3+
a,b
4+
a,b

test/pending/run/t3899/Base_1.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class Base_1 {
2+
public String[] varargs1(String... as) {
3+
return as;
4+
}
5+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
trait T extends Base_1 {
2+
def t1(as: String*): Array[String] = {
3+
varargs1(as: _*)
4+
}
5+
def t2(as: String*): Array[String] = {
6+
// This is the bug reported in the ticket.
7+
super.varargs1(as: _*)
8+
}
9+
}
10+
11+
class C extends Base_1 {
12+
def c1(as: String*): Array[String] = {
13+
varargs1(as: _*)
14+
}
15+
def c2(as: String*): Array[String] = {
16+
super.varargs1(as: _*)
17+
}
18+
}
19+
20+
21+
object Test extends App {
22+
val t = new T {}
23+
println(t.t1("a", "b").mkString(","))
24+
println(t.t2("a", "b").mkString(","))
25+
26+
val c = new C {}
27+
println(c.c1("a", "b").mkString(","))
28+
println(c.c2("a", "b").mkString(","))
29+
30+
}

0 commit comments

Comments
 (0)