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,360
    • Issues 5,360
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 567
    • Merge requests 567
  • 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
  • #7525
Closed
Open
Issue created Dec 23, 2012 by parcs@trac-parcs

Compiler panic with ill-typed code using implicit parameters

The following snippet produces a compiler panic with GHC 7.7.20121221:

{-# LANGUAGE ImplicitParams #-}

hmm :: ()
hmm = let ?a = True in ?a

main = print hmm

Which results in the error message:

[1 of 1] Compiling Main             ( bug.hs, bug.o )
ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 7.7.20121221 for x86_64-unknown-linux):
        ASSERT failed!
    file compiler/typecheck/TcMType.lhs line 407
    Double update of meta tyvar
      t_ajp{tv} [tau[0]]
      Indirect ghc-prim:GHC.Types.Bool{(w) tc 3c}

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Note that the same snippet compiled with GHC 7.6.1 doesn't panic, and instead gives a type error:

[1 of 1] Compiling Main             ( bug.hs, bug.o )

bug.hs:4:24:
    Couldn't match type `Bool' with `()'
    When using functional dependencies to combine
      ?a::Bool,
        arising from the implicit-parameter bindings for ?a
        at bug.hs:4:7-25
      ?a::(),
        arising from a use of implicit parameter `?a' at bug.hs:4:24-25
    In the expression: ?a
    In the expression: let ?a = True in ?a
Trac metadata
Trac field Value
Version 7.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
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