Skip to content

Commit

Permalink
fixes types of groups and all to include (Option String) in vectors.
Browse files Browse the repository at this point in the history
Groups defined in a pattern that are part of an alternation may not capture anything and will result in a nil value being captured. The types need to reflect this
  • Loading branch information
brehaut committed Mar 11, 2013
1 parent 7da39d5 commit a04a128
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/re/typed.clj
Expand Up @@ -55,9 +55,9 @@


(ann groups
(Fn [Matcher -> (IPersistentVector String)]
(Fn [Matcher -> (IPersistentVector (Option String))]
[Matcher (U (Value 0) (Value 1)) ->
(IPersistentVector String)]))
(IPersistentVector (Option String))]))
(tc-ignore
(defn groups
([^Matcher m min]
Expand All @@ -72,7 +72,7 @@


(ann all
[Matcher -> (IPersistentVector String)])
[Matcher -> (IPersistentVector (Option String))])
(defn all [^Matcher m]
(groups m 0))

Expand Down

0 comments on commit a04a128

Please sign in to comment.