forked from WICG/attribution-reporting-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Maybe.flatten function (WICG#1337)
It was unsound because it could be called with a Maybe<T> but its type parameter T instantiated with Maybe<T>, resulting in an apparent return type of Maybe<Maybe<T>>, but the instanceof check would cause the original Maybe<T> to be returned. For example, the following code logs "number" despite y's type indicating that its value should be another Maybe: ```ts const x = Maybe.some(5) const y: Maybe<Maybe<number>> = Maybe.flatten<Maybe<number>>(x) console.log(typeof y.value) ```
- Loading branch information
Showing
3 changed files
with
62 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters