Allow expressions that evaluate to types in defalias
This commit is contained in:
parent
95856cb4f3
commit
49f9e60b11
1 changed files with 3 additions and 2 deletions
|
|
@ -781,7 +781,8 @@
|
|||
aliased type."
|
||||
{:style/indent [:defn]}
|
||||
[new-type aliased-type]
|
||||
(if (primitive-type aliased-type)
|
||||
(if (and (s/valid? ::type aliased-type)
|
||||
(primitive-type aliased-type))
|
||||
`(let [aliased# ~aliased-type]
|
||||
(defmethod primitive-type ~new-type
|
||||
[_type#]
|
||||
|
|
@ -804,4 +805,4 @@
|
|||
(deserialize-from segment# aliased#)))))
|
||||
(s/fdef defalias
|
||||
:args (s/cat :new-type qualified-keyword?
|
||||
:aliased-type ::type))
|
||||
:aliased-type any?))
|
||||
|
|
|
|||
Loading…
Reference in a new issue