Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,261
    • Issues 5,261
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 565
    • Merge requests 565
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #2713
Closed
Open
Issue created Oct 20, 2008 by BenMoseley@trac-BenMoseley

Fixities interact badly with TH under GHC 6.10.1 20081007

{-# LANGUAGE TemplateHaskell #-}
module Fixity where

class MyClass a where
   (.*.) :: a -> a -> a

main = putStrLn "hi"

-- $( [d| x = undefined |] )

infixr 3 .*.

Compiling the above with: c:\ghc\ghc-6.10.0.20081007\bin\ghc.exe --make -ddump-hi ~/Fixity.hs gives:

==================== FINAL INTERFACE ====================
interface main:Fixity 610020081007
 interface hash: 791ca25a8ddea4dee47d108320bf5b50
 ABI hash: c2ca52d8c1ffc89265effb15d766f4aa
 export-list hash: 9613c0af035884a108b9bebc1c0b08b6
 orphan hash: 693e9af84d3dfcc71e640e005bdc5e2e
 where
export main:Fixity MyClass|{.*. MyClass} main
module dependencies:
package dependencies: ghc-prim integer base
orphans: base:Control.Exception.Base base:Data.Tuple base:GHC.Base
        base:GHC.Float base:GHC.Num
family instance modules:
import base:Prelude eac9ca3c0ae6d00a0fc0f1832a247e5e
import base:System.IO 9fa582151667de94fbfb9074e3c0f1b4
fixities infixr 3 .*.
1bcd9343d420eae1078ef2fa9021dbf8
 class MyClass a
     RecFlag NonRecursive
     .*. :: a -> a -> a
96fb86d3649acbcf89c1f2802a511b0e
 main :: GHC.IOBase.IO ()
vectorised variables:
vectorised tycons:
vectorised reused tycons:

Which is fine. Uncommenting the TH line and recompiling though gives:

==================== FINAL INTERFACE ====================
interface main:Fixity 610020081007
 interface hash: 0a7949a029127113f8c49434e22bcb71
 ABI hash: 3e2e66371e835a766a2fdedd54cb2c35
 export-list hash: 73f4a7845d4b5048d9321b0e99b46428
 orphan hash: 693e9af84d3dfcc71e640e005bdc5e2e
 where
export main:Fixity MyClass|{.*. MyClass} main x
module dependencies:
package dependencies: ghc-prim integer base template-haskell
orphans: base:Control.Exception.Base base:Data.Tuple base:GHC.Base
        base:GHC.Float base:GHC.Num
family instance modules:
import base:GHC.Err 357889242e9fa603050a70e6dac2a5e4
import base:Prelude eac9ca3c0ae6d00a0fc0f1832a247e5e
import base:System.IO 9fa582151667de94fbfb9074e3c0f1b4
852943708ad257bdcf76e94914bb84b2
 class MyClass a
     RecFlag NonRecursive
     .*. :: a -> a -> a
96fb86d3649acbcf89c1f2802a511b0e
 main :: GHC.IOBase.IO ()
41850025600a6740465944638d138bc4
 x :: forall a. a
vectorised variables:
vectorised tycons:
vectorised reused tycons:
  1. ..ie the "fixities" entry is lost.

This worked fine in 6.8.2.

http://hackage.haskell.org/trac/ghc/ticket/2632 may be related - but that was marked as closed/merged on 4th Oct, and I'm using a GHC

Trac metadata
Trac field Value
Version 6.10.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Template Haskell
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking