From d34adff8940201bccb83fd38caa3798b8fa8e994 Mon Sep 17 00:00:00 2001 From: aarne Date: Sun, 2 Dec 2012 19:40:45 +0000 Subject: [PATCH] produce error message instead of failure of irrefutable pattern Ok ty_C in GrammarToPGF, to help find compilation errors; the ones I've found are because an inherited abstract excludes something that the inherited concrete does not exclude. --- src/compiler/GF/Compile/GrammarToPGF.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/GF/Compile/GrammarToPGF.hs b/src/compiler/GF/Compile/GrammarToPGF.hs index ae627f9e2..5515a8876 100644 --- a/src/compiler/GF/Compile/GrammarToPGF.hs +++ b/src/compiler/GF/Compile/GrammarToPGF.hs @@ -215,7 +215,8 @@ genCncFuns gr am cm seqs0 cdefs fid_cnt cnccats = mkCncFuns [] fid_cnt funs_cnt seqs funs lindefs crc prods = (fid_cnt,funs_cnt,seqs,funs,prods) mkCncFuns (((m,id),CncFun _ _ _ (Just (PMCFG prods0 funs0))):cdefs) fid_cnt funs_cnt seqs funs lindefs crc prods = - let Ok ty_C = fmap GM.typeForm (Look.lookupFunType gr am id) + let ---Ok ty_C = fmap GM.typeForm (Look.lookupFunType gr am id) + ty_C = err error (\x -> x) $ fmap GM.typeForm (Look.lookupFunType gr am id) !funs_cnt' = let (s_funid, e_funid) = bounds funs0 in funs_cnt+(e_funid-s_funid+1) !(fid_cnt',crc',prods')