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,322
    • Issues 4,322
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 362
    • Merge Requests 362
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #13766

Closed
Open
Opened May 29, 2017 by edsko@edsko.net@trac-edsko

Confusing "redundant pattern match" in 8.0, no warning at all in 8.2

I couldn't find an existing ticket about this, so I figured I'd file this even though it's probably an instance of a more general problem. Consider

{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wall -Woverlapping-patterns #-}

module T where

class C a where
  c :: a -> a

instance Int ~ Bool => C Int where
  c = id

yields

T.hs:10:3: warning: [-Woverlapping-patterns]
    Pattern match is redundant
    In an equation for ‘c’: c = ...

which I suppose makes some amount of sense but is highly confusing nonetheless :)

Now in 8.2 I don't get this warning, but in fact I don't get any warning at all, which I'm not entirely sure is better. In the real code obviously the superclass constraint was far more complicated and it was nice of ghc to warn me (albeit in a roundabout way) that it was unsatisfiable.

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Edited Mar 10, 2019 by edsko@edsko.net
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#13766