Repro steps
This script works fine, but when we uncomment the BindReturn member it fails because it seems it doesn't use the Zero method.
type Builder () =
member __.ReturnFrom (expr) = expr : seq<'T>
member inline __.Return (x: 'T) = Seq.singleton x : seq<'T>
member inline __.Yield (x: 'T) = Seq.singleton x : seq<'T>
member inline __.Bind (p: seq<'T>, rest: 'T->seq<'U>) = Seq.collect rest p : seq<'U>
member inline __.Delay (expr: _->seq<'T>) = Seq.delay expr : seq<'T>
member __.Run f = f : seq<'T>
member inline __.Zero () = Seq.empty : seq<'T>
// member inline __.BindReturn (x : seq<'T>, f: 'T -> 'U) : seq<'U> = Seq.map f x
let seqbuilder= new Builder ()
let _pythags = seqbuilder {
let! z = seq [1..50]
let! x = seq [1..z]
let! y = seq [x..z]
if (x*x + y*y = z*z) then return (x, y, z) }
Expected behavior
Compile fine with the BindReturn member
Actual behavior
Doesn't compile with the BindReturn member
Known workarounds
Add an else branch. but still looks like a regression.
Related information
F# 5.0
Repro steps
This script works fine, but when we uncomment the
BindReturnmember it fails because it seems it doesn't use theZeromethod.Expected behavior
Compile fine with the
BindReturnmemberActual behavior
Doesn't compile with the
BindReturnmemberKnown workarounds
Add an else branch. but still looks like a regression.
Related information
F# 5.0