summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Williams <alexis@typedr.at>2019-12-27 18:23:39 -0800
committerAlexis Williams <alexis@typedr.at>2019-12-27 18:23:39 -0800
commitfa8a451cb745237f6be7ee257dd325e77ccf8a0d (patch)
tree3b0c0f2b47b9e22070bd239eb92d5c117aa82643
parentbed8ab328c1ba2a7e5977081f1b962fd26a26bec (diff)
downloadhaskell-wip/linear_rules.tar.gz
Fix array empty predicateswip/linear_rules
-rw-r--r--compiler/specialise/Rules.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs
index bdf196a163..4233980ea4 100644
--- a/compiler/specialise/Rules.hs
+++ b/compiler/specialise/Rules.hs
@@ -41,7 +41,8 @@ import CoreUtils ( exprType, eqExpr, mkTick, mkTicks,
isJoinBind )
import PprCore ( pprRules )
import Type ( Type, TCvSubst, extendTvSubst, extendCvSubst
- , mkEmptyTCvSubst, substTy )
+ , mkEmptyTCvSubst, substTy, tyConAppTyCon_maybe )
+import TyCon ( isClassTyCon )
import TcType ( tcSplitTyConApp_maybe )
import TysWiredIn ( anyTypeOfKind )
import Coercion
@@ -519,8 +520,8 @@ matchRule _ in_scope is_active _ args rough_args
| not (is_active act) = Left []
| ruleCantMatch tpl_tops rough_args = Left []
| not rule_auto
- , [] /= tpl_vars
- , [] /= nonAffineOrDictArgs = Left nonAffineOrDictArgs
+ , not (null tpl_vars)
+ , not (null nonAffineOrDictArgs) = Left nonAffineOrDictArgs
| otherwise = case matchN in_scope rule_name tpl_vars tpl_args args rhs of
Just match -> Right match
Nothing -> Left []