to-java not working when setter takes Map as parameter
Description
If I have the following class:
And I run the following clojure:
The final line throws a java.lang.InstantiationException: java.util.Map exception (full stack trace found below). It looks like there's a to-java method that, when it gets a APersistentMap, tries to create an instance of the type of the parameter which in this case is a Map interface, which of course cannot be instantiated.
I'm wondering why the APersistentMap wouldn't be passed in directly, as it implements the Map interface?
Environment
None
Activity
Show:
Sean Corfield October 13, 2019 at 7:52 PM
Release 0.1.3
Sean Corfield October 13, 2019 at 6:24 AM
Will be in 0.1.3 release.
When a
setter is matched to a Clojure hash map, a new
is created from the hash map and returned. When other Java interfaces that Clojure's hash map implements are encountered, the hash map is returned as-is. The base case is unchanged.
This should have the fewest surprising edge cases (but I suspect only
If I have the following class:
And I run the following clojure:
The final line throws a
java.lang.InstantiationException: java.util.Map
exception (full stack trace found below). It looks like there's ato-java
method that, when it gets aAPersistentMap
, tries to create an instance of the type of the parameter which in this case is aMap
interface, which of course cannot be instantiated.I'm wondering why the
APersistentMap
wouldn't be passed in directly, as it implements theMap
interface?