Skip to content

Commit

Permalink
Test cases for a few accidentally-fixed bugs.
Browse files Browse the repository at this point in the history
- scala/bug#5638 was fixed by something farther back than I can build.
- scala/bug#8348 was fixed by #5251.
- scala/bug#9291 was fixed by #6092.
  • Loading branch information
hrhino committed Jan 16, 2018
1 parent 68d6696 commit eee8097
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/files/pos/t5638/Among.java
@@ -0,0 +1,5 @@
public class Among {

/** class body */

};
3 changes: 3 additions & 0 deletions test/files/pos/t5638/Usage.scala
@@ -0,0 +1,3 @@
object Usage {
def among: Among = new Among
}
10 changes: 10 additions & 0 deletions test/files/pos/t9291.scala
@@ -0,0 +1,10 @@
// more than one field is required to trigger crash
// there must be a default value for one of the parameters
case class OuterObject(field: Int = 1, anotherField: Int = 2)

object Test {
OuterObject().copy(field = OuterObject().field)

// declaring something without explicit type, with the same name as OuterObject.field
def field = "anything"
}
2 changes: 2 additions & 0 deletions test/files/run/t8348.check
@@ -0,0 +1,2 @@
1
1
5 changes: 5 additions & 0 deletions test/files/run/t8348/TableColumn.java
@@ -0,0 +1,5 @@
package j;

public @interface TableColumn {
int width() default -1;
}
15 changes: 15 additions & 0 deletions test/files/run/t8348/TableColumnImpl.java
@@ -0,0 +1,15 @@
package j;

import java.lang.annotation.*;

public class TableColumnImpl implements TableColumn {
private final int width;

public TableColumnImpl(int width) { this.width = width; }

@Override public int width() { return this.width; }

@Override public Class<? extends Annotation> annotationType() {
return TableColumn.class;
}
}
9 changes: 9 additions & 0 deletions test/files/run/t8348/Test.scala
@@ -0,0 +1,9 @@
object Test extends App {
import j._

val column = new TableColumnImpl(1)

println(column.width)
println((column: TableColumn).width)

}

0 comments on commit eee8097

Please sign in to comment.