X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fspecialise%2FRules.lhs;h=6a4dff08088203cc634894cc394be1558a2737be;hp=65975f81cb537372135332c1b567c558775ff8a7;hb=7ecf87b26ca50c1b6def186c32f4dfa0e9cedb97;hpb=c0fe534fbf3d3e30a6f35b355da86e6f18601348 diff --git a/compiler/specialise/Rules.lhs b/compiler/specialise/Rules.lhs index 65975f8..6a4dff0 100644 --- a/compiler/specialise/Rules.lhs +++ b/compiler/specialise/Rules.lhs @@ -123,11 +123,13 @@ ruleCantMatch :: [Maybe Name] -> [Maybe Name] -> Bool -- It's only a one-way match; unlike instance matching we -- don't consider unification -- --- Notice that there is no case --- ruleCantMatch (Just n1 : ts) (Nothing : as) = True --- Reason: a local variable 'v' in the actuals might --- have an unfolding which is a global. --- This quite often happens with case scrutinees. +-- Notice that [_$_] +-- ruleCantMatch [Nothing] [Just n2] = False +-- Reason: a template variable can be instantiated by a constant +-- Also: +-- ruleCantMatch [Just n1] [Nothing] = False +-- Reason: a local variable 'v' in the actuals might [_$_] + ruleCantMatch (Just n1 : ts) (Just n2 : as) = n1 /= n2 || ruleCantMatch ts as ruleCantMatch (t : ts) (a : as) = ruleCantMatch ts as ruleCantMatch ts as = False