Skip to content

Incorrect result for nested constructors #5081

Description

@Aster89

In a case as simple as this

{-# LANGUAGE EmptyCase #-}
{-# OPTIONS_GHC -Wall -fmax-uncovered-patterns=99 #-}
module T where

foo :: Int
foo = case (_ :: Bool, _ :: Bool) of

where the diagnostic has good suggestions,

 ╔══════════════════════════════════════════════════╗
 ║ Pattern match(es) are non-exhaustive             ║
 ║ In a case alternative:                           ║
 ║     Patterns of type ‘(Bool, Bool)’ not matched: ║
 ║         (False, False)                           ║
 ║         (False, True)                            ║
 ║         (True, False)                            ║
 ║         (True, True) [GHC-62161]                 ║
 ╚══════════════════════════════════════════════════╝

the completion is erroneous:

bar = case (_ :: Bool, _ :: Bool) of
  (,) _ _ -> _
  (,) _ _ -> _
  (,) _ _ -> _
  (,) _ _ -> _

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: hls-case-split-pluginIssues related to the hls-case-split-pluginstatus: needs triagetype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions