[CLJ-938] Output of clojure.reflect is not suitable for type hints Created: 23/Feb/12 Updated: 24/Feb/12 |
|
| Status: | Open |
| Project: | Clojure |
| Component/s: | None |
| Affects Version/s: | Release 1.3 |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Minor |
| Reporter: | Brandon Bloom | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I'm trying to write a macro which generate reify forms using some reflection. clojure.reflect produces type symbols similar to 'java.util.Iterator<> Unfortunately, the compiler doesn't accept the <> syntax in type hints: (reify Iterable (^{:tag java.util.Iterator} iterator [this] nil)) ; works (reify Iterable (^{:tag java.util.Iterator<>} iterator [this] nil)) ;; fails It seems like the compiler should understand the <> just enough to strip it, rather than reject it. This would make it much easier to write correct macros involving type hinting and reflection. The workaround I have been using is: (defn hint |
| Comments |
| Comment by Brandon Bloom [ 24/Feb/12 1:37 AM ] |
|
I'm sorry, I got this wrong earlier. The problem is real, but it's arrays, not generics. My workaround is useless... :-/ |