-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'typetools:master' into bugfix/wpi-loop-unknowninitializ…
…ation
- Loading branch information
Showing
6 changed files
with
59 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// @below-java17-jdk-skip-test | ||
// @infer-jaifs-skip-test | ||
// from https://docs.oracle.com/en/java/javase/15/language/sealed-classes-and-interfaces.html | ||
|
||
public sealed class Figure | ||
// The permits clause has been omitted | ||
// as its permitted classes have been | ||
// defined in the same file. | ||
{} | ||
|
||
@SuppressWarnings("initializedfields:contracts.postcondition") | ||
final class Circle extends Figure { | ||
float radius; | ||
} | ||
|
||
@SuppressWarnings("initializedfields:contracts.postcondition") | ||
non-sealed class Square extends Figure { | ||
float side; | ||
} | ||
|
||
@SuppressWarnings("initializedfields:contracts.postcondition") | ||
sealed class Rectangle extends Figure { | ||
float length, width; | ||
} | ||
|
||
@SuppressWarnings("initializedfields:contracts.postcondition") | ||
final class FilledRectangle extends Rectangle { | ||
int red, green, blue, sealed; | ||
} |