From ed46bb13647a387291340a8ee40cc61a0cb8db4d Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 21 Dec 2006 10:38:26 +0000 Subject: [PATCH] length test in overload --- src/GF/Compile/CheckGrammar.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs index 53c8dbab9..6ac23e3b2 100644 --- a/src/GF/Compile/CheckGrammar.hs +++ b/src/GF/Compile/CheckGrammar.hs @@ -617,8 +617,9 @@ getOverload env@gr mt t = case appForm t of ---- TODO: use a trie lookupOverloadInstance tys typs = [(mkFunType rest val, t) | - (ty,(val,t)) <- typs, - let (pre,rest) = splitAt (length tys) ty, + let lt = length tys, + (ty,(val,t)) <- typs, length ty >= lt, + let (pre,rest) = splitAt lt ty, pre == tys ]