Skip to content

Stan plugin recommends StrictData pragma even when it is in scope #3174

Closed
@lsmor

Description

@lsmor

Your environment

Which OS do you use?
Ubuntu 20.0.4 Focal
Which version of GHC do you use and how did you install it?
ghc-8.10.7 with ghcup
How is your project built (alternative: link to the project)?
with cabal

Which LSP client (editor/plugin) do you use?
VsCode with haskell extension
Which version of HLS do you use and how did you install it?
hls-1.8.0 I did install it with ghcup manually pointing to debian bindist, instead of default fedora as explain in this comment
Have you configured HLS in any way (especially: a hie.yaml file)?
My hie.yaml is just

cradle:
  cabal:

Steps to reproduce

on a normal cabal project write a module

{-# LANGUAGE StrictData #-}

module MyModule where

data A = A {field :: Int, field2 :: String}

Expected behaviour

No error or warnings should happen with respect to strict fields

Actual behaviour

Stan underlies the field's accessors and recommends to add the StrictData pragma. Notice that Stan also recommends adding a bang pattern, and if you do that, then the warning disappears.

Debug information

This is the last output of hls. It seems that StrictData pragma is reconigze within the module, so I guess the problem is completely up to stan plugin. This is double inconviniently because stan can't be disable or at leat I haven't found the way either: #3157

[Trace - 19:26:53] Received notification 'window/logMessage'.
Using extensions for  NormalizedFilePath "/home/luis/Proyectos/<path/to/module>": [ MonomorphismRestriction
                                                                                  , RelaxedPolyRec
                                                                                  , ForeignFunctionInterface
                                                                                  , ImplicitPrelude
                                                                                  , DoAndIfThenElse
                                                                                  , EmptyDataDecls
                                                                                  , PatternGuards
                                                                                  , DatatypeContexts
                                                                                  , TraditionalRecordSyntax
                                                                                  , EmptyCase
                                                                                  , StrictData
                                                                                  , StarIsType
                                                                                  , CUSKs ]
[Trace - 19:26:53] Received notification 'window/logMessage'.
[Info  - 19:26:53] Typechecking reverse dependencies for NormalizedFilePath "//home/luis/Proyectos/<path/to/module>": [  ]
[Trace - 19:26:53] Received notification 'window/logMessage'.
Finished: ParentTC Took: 0.00s
[Trace - 19:26:53] Received request 'window/workDoneProgress/create - (68)'.
[Trace - 19:26:53] Sending response 'window/workDoneProgress/create - (68)'. Processing request took 0ms
[Trace - 19:26:53] Received notification '$/progress'.
[Trace - 19:26:53] Received notification '$/progress'.
[Trace - 19:26:53] Received request 'window/workDoneProgress/create - (69)'.
[Trace - 19:26:53] Sending response 'window/workDoneProgress/create - (69)'. Processing request took 0ms
[Trace - 19:26:53] Received notification '$/progress'.
[Trace - 19:26:53] Received notification '$/progress'.
[Trace - 19:26:54] Received notification '$/progress'.
2022-09-15T17:27:29.314287Z | Info | Live bytes: 181.82MB Heap size: 554.70MB

Metadata

Metadata

Assignees

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