Skip to content

:force of multiple values results in ASSERT failed! file compiler/types/TyCoSubst.hs, line 384

Summary

With GHC Head 8.9.0.20191103 when I force multiple values in a single :force command, I get an ASSERT failed! file compiler/types/TyCoSubst.hs, line 384. It works, when I do multiple :force commands, each one with only a single value

Steps to reproduce

Use program Sort.hs:

module Sort (sort) where

sort :: Ord a => [a] -> [a]
sort [] = []
sort (x:xs) = insert x (sort xs)

insert :: Ord a => a -> [a] -> [a]
insert x [] = [x]
insert x (y:ys) | x < y     = x:y:ys
                | otherwise = y:(insert x ys)

In GHCi run the commands from the following session:

GHCi, version 8.9.0.20191103: https://www.haskell.org/ghc/  :? for help
Prelude> :l Sort
[1 of 1] Compiling Sort             ( Sort.hs, interpreted )
Ok, one module loaded.
*Sort> :br 5
Breakpoint 0 activated at Sort.hs:5:15-32
*Sort> sort [3,2,1]
Stopped in Sort.sort, Sort.hs:5:15-32
_result :: [a] = _
x :: a = _
xs :: [a] = [_,_]
[Sort.hs:5:15-32] *Sort> :force x xs _result
*** Exception: ASSERT failed! file compiler/types/TyCoSubst.hs, line 384

Expected behavior

Similar result as when I send 3 :force commands with only one value

GHCi, version 8.9.0.20191103: https://www.haskell.org/ghc/  :? for help
Prelude> :l Sort.hs
[1 of 1] Compiling Sort             ( Sort.hs, interpreted )
Ok, one module loaded.
*Sort> :br 5
Breakpoint 0 activated at Sort.hs:5:15-32
*Sort> sort [3,2,1]
Stopped in Sort.sort, Sort.hs:5:15-32
_result :: [a] = _
x :: a = _
xs :: [a] = [_,_]
[Sort.hs:5:15-32] *Sort> :force x
x = 3
[Sort.hs:5:15-32] *Sort> :force xs
xs = [2,1]
[Sort.hs:5:15-32] *Sort> :force _result
*** Ignoring breakpoint
*** Ignoring breakpoint
*** Ignoring breakpoint
_result = [1,2,3]
[Sort.hs:5:15-32] *Sort> 
 

Environment

  • GHC version used: 8.9.0.20191103 branch master (without local changes!)

Optional:

  • Operating System: Debian 9
  • System Architecture: x86_64
Edited by Roland Senn
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information