Heyo, I was experimenting with smarter matching ye...
# pattern-matching
s
Heyo, I was experimenting with smarter matching yesterday, trying to make it work for sealed classes Here we have a problem, that the call cannot be associated with the variable in the when expr anymore, as it could be of the wrong type 🙂 I think now it is time to go into IR wonderland. My plan here is to mark all expressions that look like pattern matching and then find them in IR to replace the calls. Idea is to have
Person(_, capturedVariable)
to be converted into
is Person -> { val captured = capturedVariable }
Not sure for how it'll go, just wanted to share things I am looking at.