summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/GF/Compile/TypeCheck/RConcrete.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/GF/Compile/TypeCheck/RConcrete.hs b/src/compiler/GF/Compile/TypeCheck/RConcrete.hs
index 67ff26115..9d987d965 100644
--- a/src/compiler/GF/Compile/TypeCheck/RConcrete.hs
+++ b/src/compiler/GF/Compile/TypeCheck/RConcrete.hs
@@ -386,7 +386,9 @@ getOverload gr g mt ot = case appForm ot of
---- "with argument types" <+> hsep (map (ppTerm Qualified 0) tys) $$
"resolved by selecting the first of the alternatives" $$
nest 2 (vcat [ppTerm Qualified 0 fun | (_,ty,fun) <- vfs1 ++ if null vfs1 then vfs2 else []])
- return $ head [(mkApp fun tts,val) | (val,fun) <- nps1 ++ nps2]
+ case [(mkApp fun tts,val) | (val,fun) <- nps1 ++ nps2] of
+ [] -> checkError $ "no alternatives left when resolving" <+> ppTerm Unqualified 0 f
+ h:_ -> return h
matchVal mt v = elem mt [Nothing,Just v,Just (unlocked v)]