Allow stream return type (#39)

This commit is contained in:
Patrick Stevens
2023-12-29 18:36:10 +00:00
committed by GitHub
parent dc0f0803b3
commit 9e9744d37b
6 changed files with 155 additions and 1 deletions

View File

@@ -116,6 +116,16 @@ module internal SynTypePatterns =
| _ -> None
| _ -> None
let (|Stream|_|) (fieldType : SynType) : unit option =
match fieldType with
| SynType.LongIdent ident ->
match ident.LongIdent |> List.map (fun i -> i.idText) with
| [ "System" ; "IO" ; "Stream" ]
| [ "IO" ; "Stream" ]
| [ "Stream" ] -> Some ()
| _ -> None
| _ -> None
let (|NumberType|_|) (fieldType : SynType) =
match fieldType with
| SynType.LongIdent ident ->