[lworld] javac is accepting erroneous synchronized statements

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • repo-valhalla
    • Affects Version/s: repo-valhalla
    • Component/s: tools

      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 this code 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
          }
      }

            Assignee:
            Vicente Arturo Romero Zaldivar
            Reporter:
            Vicente Arturo Romero Zaldivar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: