Permalink
Browse files

fixes types of groups and all to include (Option String) in vectors.

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...
1 parent 7da39d5 commit a04a12819004ae4da0eaba8805c3c6aa0dccd6f1 @brehaut committed Mar 11, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/re/typed.clj
View
@@ -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]
@@ -72,7 +72,7 @@
(ann all
- [Matcher -> (IPersistentVector String)])
+ [Matcher -> (IPersistentVector (Option String))])
(defn all [^Matcher m]
(groups m 0))

0 comments on commit a04a128

Please sign in to comment.