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
but it's cumbersome to register a new optional type, can we not have something generic?
Reacted by Bruce Mitchener, Anthony Catel, klr, Sebastian Alff, Alex Forrence, Ivan Aksamentov, Tzvetelin Vassilev, WRCIECH, Anton Semenov, l2xl and 2 more
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.
Activity
skonstant commentedon Jan 19, 2021
Any progress on this?
I have done Typescript "bindings" for this now:
export abstract class Optional<T> { has_value(): boolean; value(): T; delete(); }and
export class OptionalString extends Optional<string> {}But again it is pretty poor, it would be much better to have undefined or null or the value, this way we could use it as falsy.
stale commentedon Apr 16, 2022
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.
mrroohian commentedon Aug 21, 2023
For anyone still interested I've a workaround here: #20082 (comment)
brendandahl commentedon Jan 24, 2024
Fixed by #21076