Closed jfmengels closed 2 years ago
@jfmengels It helps with one of the false positives but doesn't help with the other one (LabelOrientation
). 🤔
@Janiczek Hmm. Could you have some time to create an SSCCE for that one? No rush though!
@jfmengels Hey there, here is a SSCCE for the second case. Seems like whenever I add the missing type annotation for the unwrapper, the false positive goes away.
module Main exposing (main)
import Config
import Html
main =
let
config =
Config.a
|> Config.useB
|> Config.unwrap
in
case config of
Config.A ->
Html.text "a"
Config.B ->
Html.text "b"
module Config exposing
( Variant(..)
, a
, unwrap
, useB
)
type Config
= Config Variant
type Variant
= A
| B
{-| The missing type annotation is important!
-}
unwrap (Config config) =
config
a : Config
a =
Config A
useB : Config -> Config
useB _ =
Config B
Fixes #61
@Janiczek This fixes the problem in the SSCCE. Can you try it out and confirm whether it works on your original code if you still have it?