From 079badf009115b7d1d2175ec3aaaf01c6803bd4f Mon Sep 17 00:00:00 2001 From: Sebastian Graf Date: Fri, 10 Mar 2023 18:25:12 +0100 Subject: Simplifier: `countValArgs` should not count Type args (#23102) I observed miscompilations while working on !10088 caused by this. Fixes #23102. Metric Decrease: T10421 --- compiler/GHC/Core/Opt/Simplify/Utils.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/GHC/Core/Opt/Simplify/Utils.hs b/compiler/GHC/Core/Opt/Simplify/Utils.hs index ffecebd876..9836557e8d 100644 --- a/compiler/GHC/Core/Opt/Simplify/Utils.hs +++ b/compiler/GHC/Core/Opt/Simplify/Utils.hs @@ -553,7 +553,7 @@ countArgs _ = 0 countValArgs :: SimplCont -> Int -- Count value arguments only -countValArgs (ApplyToTy { sc_cont = cont }) = 1 + countValArgs cont +countValArgs (ApplyToTy { sc_cont = cont }) = countValArgs cont countValArgs (ApplyToVal { sc_cont = cont }) = 1 + countValArgs cont countValArgs (CastIt _ cont) = countValArgs cont countValArgs _ = 0 -- cgit v1.2.1