Skip to content

Tidy generates looping idInfo

As of a4212edc, Tidy loops on the following input, specifically in the output idInfo of foo:

{-# LANGUAGE NoImplicitPrelude #-}
module Rec where

foo :: () -> ()
foo = foo
ghc -dno-typeable-binds -fno-omit-interface-pragmas -fexpose-all-unfoldings -dverbose-core2core /tmp/a.hs
!!! Simplifier [Rec]: finished in 0.57 milliseconds, allocated 0.623 megabytes
*** CoreTidy [Rec]:
!!! CoreTidy [Rec]: finished in 0.05 milliseconds, allocated 0.036 megabytes

==================== Tidy Core ====================
Result size of Tidy Core
  = {terms: 2, types: 2, coercions: 0, joins: 0/0}

Rec {
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
foo [Occ=LoopBreaker] :: () -> ()

This is not just a debug output issue -- without -dverbose-core2core it still hangs, since the PartialModIface ends up with a loopy ifIdInfo in the IfaceId for foo.

Edited by Gergő Érdi
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information