Closed
Description
Minimized code
From scala-swing:
import java.awt.event.WindowEvent
import java.awt.{Window => AWTWindow}
abstract class Window {
def peer: AWTWindow with InterfaceMixin
protected trait InterfaceMixin extends javax.swing.RootPaneContainer
protected trait SuperMixin extends AWTWindow {
override protected def processWindowEvent(e: WindowEvent): Unit = {
super.processWindowEvent(e)
if (e.getID == WindowEvent.WINDOW_CLOSING)
closeOperation()
}
}
def closeOperation(): Unit = ()
}
Output
compilation fails with
dotc: wrong number of arguments at crossCast for (x$0: java.awt.GraphicsConfiguration): java.awt.Window: (java.awt.Window#<init> : (x$0: java.awt.GraphicsConfiguration): java.awt.Window
), expected: 1, found: 0
Expectation
Should work as in Scala 2.12, 2.13. I does work for types other than java.awt.Window
, for example javax.swing.JComponent
, probably an issue due to the overloaded constructor.