fix: Check that all overs and unders are used in toplevel defs#48
fix: Check that all overs and unders are used in toplevel defs#48
Conversation
| f(x) = x | ||
| ^ | ||
|
|
||
| Type mismatch when checking (x,「x」) |
There was a problem hiding this comment.
Where is this (x,「x」) coming from?
There was a problem hiding this comment.
Not sure, but that doesn't look right! My guess is that (x, 「x」) is the LHS and RHS of this clause
brat/Brat/Checker.hs
Outdated
| where | ||
| checkConnectorsUsed _ _ _ ([], []) = pure () | ||
| checkConnectorsUsed (_, tmFC) tm (_, unders) ([], rightUnders) = localFC tmFC $ | ||
| err (TypeMismatch tm (showRow unders) (showRow (filter ((`notElem` (fst <$> rightUnders)) . fst) unders))) |
There was a problem hiding this comment.
Can't you do drop (length rightUnders) unders instead of the filter? The unused unders should always be on the right?
There was a problem hiding this comment.
We actually want to drop everything until rightUnders, it's quite annoying
There was a problem hiding this comment.
the idiomatic ways i thought of to do this all involved a double reverse, which seems a bit objectionable
There was a problem hiding this comment.
So drop (length unders - length rightUnders) unders also doesn't work?
There was a problem hiding this comment.
🤦 yes, that should work
No description provided.