Resolve Java interoperability based on static type information
Description
Problem
Static type information can inform the Clojure compiler of non-reflective Java interop. With the typed REPL, we now have a means to communicate this information.
Approach
tools.analyzer.jvm returns :host-interop nodes for unresolved interop. We first generate type hints based on the static types of the target/argument/ expected type, then passed the type-hinted AST back into the analyzer.
If this doesn't resolve the interop, we throw a type error a usual. If it does, we type check as usual.
Problem
Static type information can inform the Clojure compiler of non-reflective
Java interop. With the typed REPL, we now have a means to communicate this
information.
Approach
tools.analyzer.jvm
returns:host-interop
nodes for unresolved interop.We first generate type hints based on the static types of the target/argument/
expected type, then passed the type-hinted AST back into the analyzer.
If this doesn't resolve the interop, we throw a type error a usual. If it does,
we type check as usual.
Pull request:
TODO WIP
extract function rewriting CTYP-259
51
55
Commit: db3a3