Skip to content

Code action to define undefined variables includes suggestions in type signature #3795

Closed
@jameshaydon

Description

@jameshaydon

Your environment

MacOS
GHC 9.4.5 from ghcup
cabal
emacs+lsp-mode
HLS v2.2.0.0 from ghcup

Steps to reproduce

Write some code with an undefined variable, e.g.:

foo :: Int -> Int
foo x = plus x (plus x x)

Invoke the code action Define plus...

Result:

plus :: Int -> t0 -> Int Suggested fix: Perhaps use mplus (imported from Control.Monad.Reader)
plus = _

Expected behaviour

The suggestion should not be in the type signature, possibly it could be a comment before/after the type signature.

Actual behaviour

Suggestion in the signature, causing a parse error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: 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