Skip to content

Commit

Permalink
Update assignability test
Browse files Browse the repository at this point in the history
  • Loading branch information
fparain committed Jul 12, 2024
1 parent 64940dd commit ead42f9
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
*/

/*
* @ignore Fix JDK-8328438
* @test
* @summary Test basic verifier assignability of inline types.
* @enablePreview
Expand All @@ -31,11 +30,13 @@
*/

// Test that an inline type is assignable to itself, to java.lang.Object,
// and to an interface,
// to an abstract super type and to an interface,
//
interface II { }

public primitive final class VTAssignability implements II {
abstract value class AbstractValue { }

public value class VTAssignability extends AbstractValue implements II {
final int x;
final int y;

Expand All @@ -59,8 +60,12 @@ public boolean equals(Object o) {
}
}

public void takesAbstractSuper(AbstractValue val) {
System.out.println("Test passes for abstract super");
}

public void takesInterface(II i) {
System.out.println("Test passes!!");
System.out.println("Test passes for interfaces");
}

public static void main(String[] args) {
Expand All @@ -73,6 +78,9 @@ public static void main(String[] args) {
// Test assignability of an inline type to java.lang.Object.
res = b.equals(a);

// Test assignability of an inline type to an abstract super type.
a.takesAbstractSuper(b);

// Test assignability of an inline type to an interface.
a.takesInterface(b);
}
Expand Down

0 comments on commit ead42f9

Please sign in to comment.