Fix function pointer subtyping - #1737
Conversation
88ea13a to
a5680f1
Compare
|
Thanks @kimjune01 !! I'll take a look first thing tomorrow! |
|
This is the right approach to solve issues #1718 and #1184, but I'm a bit concerned that this duplicates the code for function subtyping. It's a bit tricky to abstract this because we have to support subtyping with two levels of binders ( |
|
In the spirit of "not letting the perfect be the enemy of the good" I'd rather we merge and try to coalesce later. |
|
Plus Having two concrete chunks that we want to abstract/share likely makes it easier to do the refactor.. |
|
Agree, but historically I've been the one doing these cleanups, and since I don't have much time to do it anymore, merging this PR means the code is going to stay like that unless someone else takes on the burden. |
Ideally, but it's tricky because we need to move things around, since |
|
Ah ok, so then we'd want to
|
|
Yes, but if we end up gating parts of the implementation, I don't know if that makes the overall code better. |
Relates function pointer signatures using function subtyping instead of asserting structural equality. This handles alpha-renamed bound regions in #1718 and default refinement differences in #1185.
This follows the approach discussed in the Zulip thread on moving function subtyping into
flux-infer.Adds regression coverage for generic inputs and outputs, nested function pointers, higher-ranked lifetimes, multiple binders, mutable references, and unsafe function pointers. All new cases ICE on
mainand pass with this change.Fixes #1718.
Fixes #1185.