[lworld] Integrated: 8292753: [lworld] javac is accepting erroneous synchronized statements
Vicente Romero
vromero at openjdk.org
Mon Aug 29 16:26:42 UTC 2022
On Tue, 23 Aug 2022 18:25:30 GMT, Vicente Romero <vromero at openjdk.org> wrote:
> javac should issue an error for this code:
>
> value class C<T extends C> {
> void m(T t) {
> synchronized(t) {}
> }
> }
>
> as type variable `T` is bounded by a value class. Also code like this one should be rejected:
>
> value class C<T extends C> {
> void foo(Object o) {
> synchronized ((C & I)o) {} // one of the superclasses of the intersection type is a value class
> }
> }
>
>
> TIA
This pull request has now been integrated.
Changeset: 3d9b4a7f
Author: Vicente Romero <vromero at openjdk.org>
URL: https://git.openjdk.org/valhalla/commit/3d9b4a7f2a63d393420e645dfcbb67f3e08d86a3
Stats: 42 lines in 3 files changed: 33 ins; 4 del; 5 mod
8292753: [lworld] javac is accepting erroneous synchronized statements
-------------
PR: https://git.openjdk.org/valhalla/pull/724
More information about the valhalla-dev
mailing list