我如何输入提示反射警告?

(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无法解析”


因为代理超级使用隐含this

(let [^javax.swing.JPanel this this]
  (proxy-super paintComponent g))

它看起来像是警告线

(proxy-super paintComponent g)

javax.swing.JPanel的父类是否有paintComponent方法?

删除该行适用于我。

链接地址: http://www.djcxy.com/p/43507.html

上一篇: How do I typehint away this reflection warning?

下一篇: Sparse checkouts and svn:externals