Skip to content

Commit

Permalink
Add test for dotnet#5745
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Oct 10, 2018
1 parent c256b80 commit 05ec633
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// #Regression #Conformance #PatternMatching #ActivePatterns
// Regression test for https://github.com/Microsoft/visualfsharp/issues/5745
//<Expects status="error id="FS3174">Active patterns do not have fields. This syntax is invalid\.</Expects>
open System.Text.RegularExpressions

let (|USZipPlus4Code|_|) s =
let m = Regex.Match(s, @"^(\d{5})\-(\d{4})$")
if m.Success then
USZipPlus4Code(x=m.Groups.[1].Value,
y=m.Groups.[2].Value)
|> Some
else
None
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

SOURCE=E_ActivePatterns01.fs # E_ActivePatterns01.fs
SOURCE=E_ActivePatterns02.fs # E_ActivePatterns02.fs
SOURCE=E_ActivePatternHasNoFields.fs # E_ActivePatternHasNoFields.fs
SOURCE=E_ParameterRestrictions01.fs # E_ParameterRestrictions01.fs

SOURCE=MultiActivePatterns01.fs # MultiActivePatterns01.fs
Expand Down

0 comments on commit 05ec633

Please sign in to comment.