Skip to content

Overlapping patterns warning misplaced

Consider

{-# OPTIONS_GHC -fwarn-overlapping-patterns #-}

len []    = 0
len (_:t) = 1 + len t
len _     = error "urk"

GHC reports the problem with this definition at the first line of it. I think it would be more helpful to have it at the last line, which is the pattern that will never match.

Trac metadata
Trac field Value
Version 7.7
Type Bug
TypeOfFailure OtherFailure
Priority low
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