Unexpected behavior with `Schema.Void` encoding non-`undefined` values

Hi here! Is it known that Schema.Void can encode things that are not undefined in something that is not undefined
Here's an example of such a thing (playground here):
import { Schema } from "effect"

const foo = (f: () => void) => Schema.encodeSync(Schema.Void)(f()) 

console.log(foo(() => 'bar'))
// => logs "bar"

I would have naively expected that undefined would be the encoded value in any case.
That's a bit tricky as in Typescript, a void in the return value of a function does not enforce that it will not return something.
Was this page helpful?