You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Generic typing of Option::fromValue results in Option<valueType|null> #63
Option::fromValue uses the same type parameter C for the $value and $noneValue parameters. As a result, the type of C is inferred to a union of the types of $value and $noneValue:
Fixed in 1.10.0. fromValue() now types $noneValue as mixed, so the value type is inferred from $value alone and you get back Option<T> rather than Option<T|null> — exactly as you suggested. Thanks for the clear report and playground links.
Activity
GrahamCampbell commentedon Aug 24, 2026
Fixed in 1.10.0.
fromValue()now types$noneValueasmixed, so the value type is inferred from$valuealone and you get backOption<T>rather thanOption<T|null>— exactly as you suggested. Thanks for the clear report and playground links.