Skip to content

GitLab

  • Menu
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 4,862
    • Issues 4,862
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 455
    • Merge requests 455
  • 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 Compiler
  • GHCGHC
  • Issues
  • #21032
Closed
Open
Created Feb 01, 2022 by MorrowM@MorrowMContributor

Incorrect usage of the term "bang-pattern" in error message

Summary

Given the following module:

{-# LANGUAGE NoBangPatterns #-}
module Bang where

z = let !(x,y) = (1,2) in x

We get the following error message:

Bang.hs:4:9: error:
    Illegal bang-pattern (use BangPatterns):
    ! (x, y)
  |
3 | z = let !(x,y) = (1,2) in x
  |         ^^^^^^

which is incorrect; this is a strict binding, not a bang pattern.

My suggested error message:

Bang.hs:4:9: error:
    Illegal strict binding (use BangPatterns):
    ! (x, y)
  |
3 | z = let !(x,y) = (1,2) in x
  |         ^^^^^^

Tested with GHC 8.10.7 and 9.2.1.

In GHC HEAD the message is slightly different but still uses the term "bang-pattern":

Bang.hs:4:9: error:
    Illegal bang-pattern
    !(x, y)
    Suggested fix: Perhaps you intended to use BangPatterns
  |
4 | z = let !(x,y) = (1,2) in x
  | 

OS: Manjaro Linux x86_64

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking