Skip to content

Struct representations for partial active patterns not working in recursive patterns #13378

@Thorium

Description

@Thorium

Shoud this compile?

[<return: Struct>]
let rec (|HasOne|_|) xs = 
    match xs with
    | [] -> ValueNone
    | h::_ when h = 1 -> ValueSome true
    | _::tail ->
        match tail with
        | HasOne x -> ValueSome x
        | _ -> ValueNone

// error FS0001: The type ''a option' does not match the type 'bool voption'

Metadata

Metadata

Assignees

Labels

Area-Compiler-PatternMatchingpattern compilation, active patterns, performance, codegenBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions