haskell/haskell-ide-engine

Hlint parser error on `pattern`

Open

#1.374 geöffnet am 28. Aug. 2019

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Haskell (205 Forks)batch import
component: hlintgardening 🌱good first issue

Repository-Metriken

Stars
 (2.358 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Given a module:

module Lib where

foo pattern = pattern

This error message is shown:

/tmp/ghc-mod4106/Lib4105-43.hs:3:5: error:
    parse error on input `pattern'
  module Lib where
  
> foo pattern = pattern

This is documented in https://github.com/ndmitchell/hlint/issues/607. Minimal project to reproduce: https://github.com/fendor/hlint-minimal-pattern

This happens because hlint assumes some default extensions. This makes sense, since hlint is normally not aware of a .cabal or package.yaml file, where extensions may be listed. However, HIE is aware of language extensions and could invoke hlint always with the right extensions.

Contributor Guide