Description: A specific kind of incorrect syntax in an active pattern definition causes an internal compiler error rather than a message specific to the error.
Repro Steps: Add the following code:
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
Expected: An error along the lines of:
'Active pattern bindings do not support field names.'
Actual:
'error FS0073: internal error: impossible (Failure)'
Severity: minor.
Version: F# 4.5
Workaround: Use correct active pattern syntax. In this case, omit the x= and y=.
Description: A specific kind of incorrect syntax in an active pattern definition causes an internal compiler error rather than a message specific to the error.
Repro Steps: Add the following code:
Expected: An error along the lines of:
'Active pattern bindings do not support field names.'
Actual:
'error FS0073: internal error: impossible (Failure)'
Severity: minor.
Version: F# 4.5
Workaround: Use correct active pattern syntax. In this case, omit the x= and y=.