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 ADT extension seems to be crashing when matching on a dereferenced ADT. The following is a (mostly) minimal test case:
typedef datatype Node Node;
datatype Node {
Leaf (int);
};
int main() {
Node n = *Leaf(4);
match (n) {
Leaf (i): ;
};
}
It is also unclear how to nicely handle non-pointer ADTs; We allow the user to create them and pass them around, but they always have to be written as a pointer and be used as a pointer to do anything with them. Would it make sense to automatically take the address when a match is performed on a non-pointer? Otherwise we should consider making datatypes always pointers behind the scenes, and just hiding this from the user. Also, why are ADTs pointers at the top level, anyway?
The text was updated successfully, but these errors were encountered:
Matching on a non-pointer should probably be a type error. Can you fix it?
If you'd like to do so as a learning experience, it would also be nice to try forking it, fixing the problem in a branch of your fork, and submitting a pull request that would close this issue when merged.
The ADT extension seems to be crashing when matching on a dereferenced ADT. The following is a (mostly) minimal test case:
It is also unclear how to nicely handle non-pointer ADTs; We allow the user to create them and pass them around, but they always have to be written as a pointer and be used as a pointer to do anything with them. Would it make sense to automatically take the address when a match is performed on a non-pointer? Otherwise we should consider making datatypes always pointers behind the scenes, and just hiding this from the user. Also, why are ADTs pointers at the top level, anyway?
The text was updated successfully, but these errors were encountered: