Open sgebbie opened 7 years ago
At first glance, I think this might be a "tuple of unions vs union of tuples" issue, which is a known limitation of the compiler (see https://github.com/ponylang/ponyc/issues/1892). But I could be wrong, as I haven't looked at it in detail.
It's also possible this is related to the change in #1937. This could be confirmed by testing against ponyc version 0.14.0 or earlier.
I tested this with the Wallaroo Labs ponyc version (which is ponyc 0.9 more or less) and it worked then. can confirm it doesnt work with 0.19.0. Also works with 0.14.0. Does not work with 0.15.0.
Okay, sounds like it's a side effect of #1937, then.
Removing "needs discussion", this still needs to be investigated.
@jemc do you know if you ever looked into this? i'm assuming no.
No, I haven't looked into it.
Summary
While trying to build a simple "event sourcing" style application I ran into problems with tuple matching.
Essentially if I build a tuple as a literal:
then the subsequent match matches incorrectly (not just a failed match but an incorrect match).
While, if I build the same tuple in two steps:
The
ponyc
version is:0.19.0-cf45938 [release]
Example Code
Bellow is a pared down version of my code that includes just the enough of the types in order to be able to trigger the problem. Note if
Change
has only theDependencyOp
command in its type definition (versus including theNOP
command) then the problem goes away and the tests succeed.cat _test_tuples.pony
Example Output