Skip to content

Regression: Unable to emit reference to constructor ... class is not accessible #24507

@makarius

Description

@makarius

Compiler version

OK: scala-3.3.4
BAD: scala-3.3.5
BAD: scala-3.3.7
BAD: scala-3.7.4

Minimized code

class Test extends javax.swing.JFrame { class Acc extends AccessibleJFrame }

Output

-- Error: ---------------------------------------------------------------------------------------------------------------------
1 |class Test extends javax.swing.JFrame { class Acc extends AccessibleJFrame }
  |                                                          ^^^^^^^^^^^^^^^^
  |Unable to emit reference to constructor AccessibleJFrame in class AccessibleJFrame, class AccessibleJFrame is not accessible in class Acc
1 error found

Expectation

I am using the Java Accessibility API (JAAPI) in Scala, which occasionally requires to instantiate protected inner classes. The above example used to work with scala-3.3.4, but later the compiler complained about it. It does work in Java 21.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions