Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,383
    • Issues 4,383
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 373
    • Merge Requests 373
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #18097

Closed
Open
Opened Apr 24, 2020 by aavogt@trac-aavogt

$(tupE [ [|x|] ]) /= Unit x

Summary

Today in #haskell http://tunes.org/~nef/logs/haskell/20.04.24

11:12:58 <mniip> ghc-prim:GHC.Tuple.Unit{(w) tc 42}  versus  ghc-prim:GHC.Tuple.Unit{tc rdRN}
11:14:39 <mniip> (w) indicating the wired in id (likely the name from the type sig)
11:22:10 <mniip> looks like a TH/renamer bug

Steps to reproduce

{-# LANGUAGE TemplateHaskell #-}
import Language.Haskell.TH
import GHC.Tuple

main = case $( tupE [ [| "ok" |] ] ) of Unit x -> putStrLn x
{-
runghc -dppr-debug unit.hs

unit.hs:5:41: error:
    • Couldn't match expected type ‘ghc-prim:GHC.Tuple.Unit{(w) tc 42}
                                      (ghc-prim:GHC.Types.[]{(w) tc 3Q}
                                         ghc-prim:GHC.Types.Char{(w) tc 3g})’
                  with actual type ‘ghc-prim:GHC.Tuple.Unit{tc rIJ}
                                      base:GHC.Base.String{tc rf1}’
      NB: ‘ghc-prim:GHC.Tuple.Unit{tc rIJ}’ is defined in ‘GHC.Tuple’
          ‘ghc-prim:GHC.Tuple.Unit{(w) tc 42}’ is defined in ‘GHC.Tuple’
    • In the pattern: ghc-prim:GHC.Tuple.Unit{d rIK} (x{v a2dg})
      In a case alternative:
          {unit.hs:5:41-46}
          ghc-prim:GHC.Tuple.Unit{d rIK} (x{v a2dg})
            -> {unit.hs:5:51-60}
               base:System.IO.putStrLn{v rt9}
                 {unit.hs:5:60}
                 x{v a2dg}
      In the expression:
        {unit.hs:5:8-60}
        case
            {unit.hs:5:13-36}
            (Unit {unit.hs:5:16-34}
                  "ok")
        of {
          {unit.hs:5:41-46}
          ghc-prim:GHC.Tuple.Unit{d rIK} (x{v a2dg})
            -> {unit.hs:5:51-60}
               base:System.IO.putStrLn{v rt9}
                 {unit.hs:5:60}
                 x{v a2dg} }
    • Relevant bindings include
        main:Main.main{v rOW} :: ghc-prim:GHC.Types.IO{tc 31Q}
                                   ghc-prim:GHC.Tuple.(){(w) tc 40}
          (bound at unit.hs:5:1)
  |
5 | main = case $( tupE [ [| "ok" |] ] ) of Unit x -> putStrLn x
  |                

-}

Expected behavior

It should print "ok"

Environment

  • GHC version used: 8.10.1

Optional:

  • Operating System:
  • System Architecture:
Assignee
Assign to
8.10.2
Milestone
8.10.2 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#18097