Skip to content

Commit eee8097

Browse files
committed
Test cases for a few accidentally-fixed bugs.
- scala/bug#5638 was fixed by something farther back than I can build. - scala/bug#8348 was fixed by scala#5251. - scala/bug#9291 was fixed by scala#6092.
1 parent 68d6696 commit eee8097

File tree

7 files changed

+49
-0
lines changed

7 files changed

+49
-0
lines changed

test/files/pos/t5638/Among.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class Among {
2+
3+
/** class body */
4+
5+
};

test/files/pos/t5638/Usage.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
object Usage {
2+
def among: Among = new Among
3+
}

test/files/pos/t9291.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// more than one field is required to trigger crash
2+
// there must be a default value for one of the parameters
3+
case class OuterObject(field: Int = 1, anotherField: Int = 2)
4+
5+
object Test {
6+
OuterObject().copy(field = OuterObject().field)
7+
8+
// declaring something without explicit type, with the same name as OuterObject.field
9+
def field = "anything"
10+
}

test/files/run/t8348.check

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

test/files/run/t8348/TableColumn.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package j;
2+
3+
public @interface TableColumn {
4+
int width() default -1;
5+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package j;
2+
3+
import java.lang.annotation.*;
4+
5+
public class TableColumnImpl implements TableColumn {
6+
private final int width;
7+
8+
public TableColumnImpl(int width) { this.width = width; }
9+
10+
@Override public int width() { return this.width; }
11+
12+
@Override public Class<? extends Annotation> annotationType() {
13+
return TableColumn.class;
14+
}
15+
}

test/files/run/t8348/Test.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
object Test extends App {
2+
import j._
3+
4+
val column = new TableColumnImpl(1)
5+
6+
println(column.width)
7+
println((column: TableColumn).width)
8+
9+
}

0 commit comments

Comments
 (0)