Skip to content

Commit

Permalink
Only report the first ambiguous overloading error (pschachte#463)
Browse files Browse the repository at this point in the history
If there's an unresolved residue after type checking, only report the
first one to avoid overwhelming error messages.
  • Loading branch information
pschachte authored May 14, 2024
1 parent 1ab95de commit 7fc963a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,10 @@ typecheckCalls [] residue False foreigns = do
case List.filter (List.null . typingErrs) $ snd <$> typings' of
[typing] -> put typing
_ -> do
typeErrors $ overloadErr <$> residue
typeErrors $ overloadErr
<$> case residue of
[] -> []
(e:_) -> [e]
typecheckCalls [] [] False foreigns
typecheckCalls (stmtTyping@(StmtTypings pstmt typs):calls)
residue chg foreigns = do
Expand Down

0 comments on commit 7fc963a

Please sign in to comment.