We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 082c814 commit d74645cCopy full SHA for d74645c
src/main/clojure/clojure/tools/analyzer/jvm/utils.clj
@@ -67,13 +67,16 @@
67
"Takes a Symbol, String or Class and tires to resolve to a matching Class"
68
class)
69
70
-(defn array-class [element-type]
71
- (RT/classForName
72
- (str "[" (-> element-type
73
- maybe-class
74
- Type/getType
75
- .getDescriptor
76
- (.replace \/ \.)))))
+(defn array-class
+ ([element-type] (array-class 1 element-type))
+ ([n element-type]
+ (RT/classForName
+ (str (apply str (repeat n"["))
+ (-> element-type
+ maybe-class
77
+ Type/getType
78
+ .getDescriptor
79
+ (.replace \/ \.))))))
80
81
(defn maybe-class-from-string [^String s]
82
(or (when-let [maybe-class (and (neg? (.indexOf s "."))
0 commit comments