Skip to content

Wingman produces invalid code due to missing qualifiers when ADT is in a different module #2564

@nmichael44

Description

@nmichael44

Your environment

Which OS do you use: Ubuntu

Which LSP client (editor/plugin) do you use:
VSCode with Haskell Language Support version 1.8.0

Describe your project (alternative: link to the project): stack.yaml

Steps to reproduce

Two modules: E.hs

module E (
  Oper(..)
  , Exp(..)) where

data Oper = And | Or | F1 | F2
  deriving (Eq, Show)

data Exp =
  Lit Bool
  | FunCall Oper [Exp]
  | Var String
  deriving Eq

and Bug.hs

{-# LANGUAGE LambdaCase #-}
module Bug ()
where

import qualified E

foo :: E.Exp -> E.Exp
foo = \case   Lit b -> _
  FunCall op exps -> _
  Var s -> _

when foo = \case is typed wingman suggests to complete-case-constructors. But as you can see above they are filled in but without any qualification (Lit instead of E.Lit) resulting in an invalid program.

Expected behaviour

The correct qualification should be produced.

Actual behaviour

No qualification is used resulting in an invalid program.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: wingmantype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions