Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
Source project has a limited visibility.
  • Vladislav Zavialov's avatar
    13d627bb
    Print unticked promoted data constructors (#20531) · 13d627bb
    Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
    
    Before this patch, GHC unconditionally printed ticks before promoted
    data constructors:
    
    	ghci> type T = True  -- unticked (user-written)
    	ghci> :kind! T
    	T :: Bool
    	= 'True              -- ticked (compiler output)
    
    After this patch, GHC prints ticks only when necessary:
    
    	ghci> type F = False    -- unticked (user-written)
    	ghci> :kind! F
    	F :: Bool
    	= False                 -- unticked (compiler output)
    
    	ghci> data False        -- introduce ambiguity
    	ghci> :kind! F
    	F :: Bool
    	= 'False                -- ticked by necessity (compiler output)
    
    The old behavior can be enabled by -fprint-redundant-promotion-ticks.
    
    Summary of changes:
    * Rename PrintUnqualified to NamePprCtx
    * Add QueryPromotionTick to it
    * Consult the GlobalRdrEnv to decide whether to print a tick (see mkPromTick)
    * Introduce -fprint-redundant-promotion-ticks
    
    Co-authored-by: default avatarArtyom Kuznetsov <hi@wzrd.ht>
    13d627bb
    History
    Print unticked promoted data constructors (#20531)
    Vladislav Zavialov authored and Marge Bot's avatar Marge Bot committed
    
    Before this patch, GHC unconditionally printed ticks before promoted
    data constructors:
    
    	ghci> type T = True  -- unticked (user-written)
    	ghci> :kind! T
    	T :: Bool
    	= 'True              -- ticked (compiler output)
    
    After this patch, GHC prints ticks only when necessary:
    
    	ghci> type F = False    -- unticked (user-written)
    	ghci> :kind! F
    	F :: Bool
    	= False                 -- unticked (compiler output)
    
    	ghci> data False        -- introduce ambiguity
    	ghci> :kind! F
    	F :: Bool
    	= 'False                -- ticked by necessity (compiler output)
    
    The old behavior can be enabled by -fprint-redundant-promotion-ticks.
    
    Summary of changes:
    * Rename PrintUnqualified to NamePprCtx
    * Add QueryPromotionTick to it
    * Consult the GlobalRdrEnv to decide whether to print a tick (see mkPromTick)
    * Introduce -fprint-redundant-promotion-ticks
    
    Co-authored-by: default avatarArtyom Kuznetsov <hi@wzrd.ht>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.