summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2014-10-20 20:06:46 +0000
committeraarne <aarne@chalmers.se>2014-10-20 20:06:46 +0000
commitf6441b22921c6ae24840d60b80672d499ddaef33 (patch)
treefa28f9ec425e52581f39fb26f824c36c402eec11 /src/compiler/GF/Compile
parenta9bc1160521a0196ab8407a565b7643fe649f6f6 (diff)
use of 'head' in TypeCheck/RConcrete created an uncomprehensible error message. Now checking for the emptiness of the list concerned, so that the error can be found.
Diffstat (limited to 'src/compiler/GF/Compile')
-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)]