@@ -1850,8 +1850,15 @@ matchClause' names i x y = checkRpts $ match (fullApp x) (fullApp y) where
18501850 mty <- match' ty ty'
18511851 ms <- match' s s'
18521852 return (mt ++ mty ++ ms)
1853− match (PHidden x) y = match' x y
1854− match x (PHidden y) = match' x y
1853+ match (PHidden x) (PHidden y)
1854+ | RightOK xs <- match x y = return xs -- to collect variables
1855+ | otherwise = return [] -- Otherwise hidden things are unmatchable
1856+ match (PHidden x) y
1857+ | RightOK xs <- match x y = return xs
1858+ | otherwise = return []
1859+ match x (PHidden y)
1860+ | RightOK xs <- match x y = return xs
1861+ | otherwise = return []
18551862 match (PUnifyLog x) y = match' x y
18561863 match x (PUnifyLog y) = match' x y
18571864 match (PNoImplicits x) y = match' x y