(set! *warn-on-reflection* true)
(proxy [javax.swing.JPanel] []
(paintComponent [#^java.awt.Graphics g]
(proxy-super paintComponent g)
(.fillRect g 100 100 10 10)))
“反射警告,无法解析对paintComponent的调用”
最佳答案
因为 proxy-super 使用隐式 this
。
(let [^javax.swing.JPanel this this]
(proxy-super paintComponent g))
关于reflection - 如何键入提示消除此反射警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1524614/