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
The discussion is about a potential bug in the Match.tags feature of the Effect TypeScript library when handling undefined inputs. The user _adrian_g expects the Match.tags function to properly handle an undefined input by falling back to the orElse case and returning null, as it does in the Match.when case. Instead, it throws a TypeError because it tries to read a property of undefined.
Another user, patroza, suggests that Match.tags should adopt the same semantics as Match.when, where non-object inputs are skipped to avoid such errors. patroza also provides an example showing that the code works with defined types other than undefined.
Key takeaways:
There is an inconsistency in how Match.when and Match.tags handle undefined inputs.
The issue causes a runtime error when using Match.tags with an undefined value.
It is suggested that Match.tags be modified to handle these cases similarly to Match.when.
_adrian_g is inquiring about the process for creating a GitHub issue to report the bug. patroza hints at using a command to initiate issue creation.
Summary
The discussion is about a potential bug in the
Match.tags
feature of the Effect TypeScript library when handlingundefined
inputs. The user_adrian_g
expects theMatch.tags
function to properly handle anundefined
input by falling back to theorElse
case and returningnull
, as it does in theMatch.when
case. Instead, it throws aTypeError
because it tries to read a property ofundefined
.Another user,
patroza
, suggests thatMatch.tags
should adopt the same semantics asMatch.when
, where non-object inputs are skipped to avoid such errors.patroza
also provides an example showing that the code works with defined types other thanundefined
.Key takeaways:
Match.when
andMatch.tags
handleundefined
inputs.Match.tags
with anundefined
value.Match.tags
be modified to handle these cases similarly toMatch.when
._adrian_g
is inquiring about the process for creating a GitHub issue to report the bug.patroza
hints at using a command to initiate issue creation.Discord thread
https://discord.com/channels/795981131316985866/1330857990076628992
The text was updated successfully, but these errors were encountered: