Magic constructor lookup #6841
JonathanStarup
started this conversation in
Ideas
Replies: 3 comments
-
What happens with pairs etc? What if you match on a pair of two types that both define MyFoo? |
Beta Was this translation helpful? Give feedback.
0 replies
-
I guess I am still confused about how the resolution works-- when you match on a program variable |
Beta Was this translation helpful? Give feedback.
0 replies
-
id guess different parts of the tuple have different imports But yes it seems pretty wild |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It seems that in Ocaml you can do this magic constructor lookup
Note that this doesn't work (
mylist2 doesn't have MyNil
)but this does work
where
f
has typemylist2 -> string
So it seems that they import the constructors IF the scrutinee has a known data type at the time of inference of the match.
Beta Was this translation helpful? Give feedback.
All reactions