It was unsound because it could be called with a Maybe but its type parameter T instantiated with Maybe, resulting in an apparent return type of Maybe<Maybe>, but the instanceof check would cause the original Maybe to be returned.
For example, the following code logs "number" despite y's type indicating that its value should be another Maybe:
It was unsound because it could be called with a Maybe but its type parameter T instantiated with Maybe, resulting in an apparent return type of Maybe<Maybe>, but the instanceof check would cause the original Maybe to be returned.
For example, the following code logs "number" despite y's type indicating that its value should be another Maybe: