diff options
author | Sebastian Graf <sebastian.graf@kit.edu> | 2023-03-10 18:25:12 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2023-05-15 18:34:26 -0400 |
commit | 3db2b31bedf674eb72b7db8ec2ba45e196a5db02 (patch) | |
tree | ddcabe35f3662ebcd1866d8dcedca42597f94777 | |
parent | dc291c003debaaaaf60053078e3171bdc5eaa0ac (diff) | |
download | haskell-3db2b31bedf674eb72b7db8ec2ba45e196a5db02.tar.gz |
Simplifier: `countValArgs` should not count Type args (#23102)
I observed miscompilations while working on !10088 caused by this.
Fixes #23102.
Metric Decrease:
T10421
(cherry picked from commit 559a480427a841b5189f2e6a84a38b02a7c2b8a1)
-rw-r--r-- | compiler/GHC/Core/Opt/Simplify/Utils.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Core/Opt/Simplify/Utils.hs b/compiler/GHC/Core/Opt/Simplify/Utils.hs index f542ebe7d5..949d1a1eea 100644 --- a/compiler/GHC/Core/Opt/Simplify/Utils.hs +++ b/compiler/GHC/Core/Opt/Simplify/Utils.hs @@ -552,7 +552,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 |