Incorrect `Left` and `Right` class definition
klimick opened this issue · 0 comments
klimick commented
Current definitions for Right
and Left
is incorrect:
/**
* @template-covariant L
* @template-covariant R
* @psalm-immutable
* @extends Either<L, R>
*/
final class Right extends Either { ... }
/**
* @template-covariant L
* @template-covariant R
* @psalm-immutable
* @extends Either<L, R>
*/
final class Left extends Either { ... }
Should be:
/**
* @template-covariant R
* @psalm-immutable
* @extends Either<empty, R>
*/
final class Right extends Either { ... }
/**
* @template-covariant L
* @psalm-immutable
* @extends Either<L, empty>
*/
final class Left extends Either { ... }