proxy-super does not detect base class type, causes reflection warning

Description

Example from core_print.clj:

(proxy [System.IO.StringWriter] []
(Flush []
(proxy-super Flush)
(let

(when (pos? (.Length sb))
(flush-fn (.ToString sb)))
(.set_Length sb 0)))
(Close []
(.Flush ^System.IO.StringWriter this)
(when close-fn (close-fn))
(proxy-super Close)
nil)))

The calss to proxy-super generate reflection warnings.

Environment

None

Activity

Show:
David Miller
April 7, 2019, 8:40 PM

Shadow declare this with type hint.
No general solution – ClojureJVM as the same problem.

Commit 0fe1bf63, 2019.04.07

David Miller
April 7, 2019, 8:38 PM

proxy-super has this problem generally, usual fix is to redeclare 'this' with a type hint:

(let

(proxy-super Flush))

No attempt to make a general fix – same behavior is in clojureJVM.

Completed

Assignee

David Miller

Reporter

David Miller