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
Thanks you and sharing how the lib helps my usecase
I was writing a credo check. I needed to match on "pipe operator where the second param is function application". Those kinds of patterns are pretty big:
Thank you very much for making composing pattern matches easier! I wanted to share with you how much easier it makes writing those checks :)
Actual issue
If I make a pattern like this:
defpat ok({:ok, val})
but then misuse it like this:
def my_fun(ok(value: value)) do
value
end
Notice that the binding is called val but used :value as the key in the keyword list. The error I get is:
warning: variable "value" does not exist and is being expanded to "value()", please use parentheses to remove the ambiguity or change the variable name
If I understand correctly, it means that the key value is ignored when there is no binding called this way. It might be a little bit confusing in case of typos to understand what is happening.
Would you consider it a good idea to raise in case usage of a given pattern tries to access non-existent binding?
If yes, I could try digging into it over the weekend and checking if I understand the lib enough to make that change.
The text was updated successfully, but these errors were encountered:
Hi! First of all: fantastic project!
Thanks you and sharing how the lib helps my usecase
I was writing a credo check. I needed to match on "pipe operator where the second param is function application". Those kinds of patterns are pretty big:
but using the lib makes them more manageable:
Thank you very much for making composing pattern matches easier! I wanted to share with you how much easier it makes writing those checks :)
Actual issue
If I make a pattern like this:
but then misuse it like this:
Notice that the binding is called
val
but used:value
as the key in the keyword list. The error I get is:If I understand correctly, it means that the key
value
is ignored when there is no binding called this way. It might be a little bit confusing in case of typos to understand what is happening.Would you consider it a good idea to raise in case usage of a given pattern tries to access non-existent binding?
If yes, I could try digging into it over the weekend and checking if I understand the lib enough to make that change.
The text was updated successfully, but these errors were encountered: