summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile/Compute
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/GF/Compile/Compute')
-rw-r--r--src/compiler/GF/Compile/Compute/ConcreteNew.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/compiler/GF/Compile/Compute/ConcreteNew.hs b/src/compiler/GF/Compile/Compute/ConcreteNew.hs
index e2dc1f50f..7cb31a72b 100644
--- a/src/compiler/GF/Compile/Compute/ConcreteNew.hs
+++ b/src/compiler/GF/Compile/Compute/ConcreteNew.hs
@@ -15,8 +15,8 @@ import GF.Compile.Compute.Predef(predef,predefName,delta)
import GF.Data.Str(Str,glueStr,str2strings,str,sstr,plusStr,strTok)
import GF.Data.Operations(Err,err,errIn,maybeErr,combinations,mapPairsM)
import GF.Data.Utilities(mapFst,mapSnd,mapBoth,apBoth,apSnd)
-import Control.Monad(ap,liftM,liftM2,mplus)
-import Data.List (findIndex,intersect,isInfixOf,nub,elemIndex)
+import Control.Monad(ap,liftM,liftM2,mplus,unless)
+import Data.List (findIndex,intersect,isInfixOf,nub,elemIndex,(\\))
import Data.Char (isUpper,toUpper,toLower)
import Text.PrettyPrint
import qualified Data.ByteString.Char8 as BS
@@ -325,7 +325,11 @@ valueTable env i cs =
_ -> False
valueCase (p,t) = do p' <- measurePatt # inlinePattMacro p
- let pvs = pattVars p'
+ let allpvs = allPattVars p'
+ pvs = nub allpvs
+ dups = allpvs \\ pvs
+ unless (null dups) $
+ fail $ "Pattern is not linear: "++show p'
vt <- value (extend pvs env) t
return (p', \ vs -> Bind $ \ bs -> vt (push' p' bs pvs vs))
--{-