Closed mattstermiller closed 3 years ago
I'm not familiar with signature files, but I'm assuming it's the external interface of a module. It looks like removing the Return member means that Return is no longer usable from client code, which I think is a breaking change for clients on older compilers (and clients writing code that uses the return
keyword, which almost certainly wrong code because the value is ignored). As such, I don't expect this to be merged as-is, but consider this a plea for help to fix the signature. I've tried everything I can think of, but maybe there is a way to specify the correct type that I don't know of.
Should we just remove the Return
altogether?
which I think is a breaking change for clients on older compilers
We can use a major version number bump for the package I think, it's an acceptable evolutionary change
Previously, Return accepted any type at all, but ignores the value. This leads to developers writing code like
return 1
which compiles but has no run-time effect, leaving the developer very confused. This computation expression's Return was not intended to be using explicitly with areturn
keyword but was added to allow the use ofdo!
.This commit changes Return to only accept unit to no longer allow explicit calls to return passing a value, but continue to allow
do!
.Return is being removed from the signature file because of the inability to define the correct type signature. The signature is
unit -> AsyncSeq<'T>
, but the compiler interprets this as a function that has no parameters rather than a function that has a single parameter of type unit.