diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2020-03-31 12:25:23 -0400 |
---|---|---|
committer | Ryan Scott <ryan.gl.scott@gmail.com> | 2020-04-07 19:32:47 -0400 |
commit | 5ec817a3e41b7eaa50c74701ab2d7642df86464c (patch) | |
tree | 15a6639360ecc3a5c72503932a52862b4a17292b /haddock-api/src/Haddock/Utils.hs | |
parent | cb65d6f3d452f46dcdd87347f50ce1548aa3fbbb (diff) |
Make NoExtCon fields strict
These changes are a part of a fix for
[GHC#17992](https://gitlab.haskell.org/ghc/ghc/issues/17992).
Diffstat (limited to 'haddock-api/src/Haddock/Utils.hs')
-rw-r--r-- | haddock-api/src/Haddock/Utils.hs | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock/Utils.hs b/haddock-api/src/Haddock/Utils.hs index a71c7504..df14eeb2 100644 --- a/haddock-api/src/Haddock/Utils.hs +++ b/haddock-api/src/Haddock/Utils.hs @@ -181,7 +181,6 @@ restrictDataDefn names defn@(HsDataDefn { dd_ND = new_or_data, dd_cons = cons }) [] -> defn { dd_ND = DataType, dd_cons = [] } [con] -> defn { dd_cons = [con] } _ -> error "Should not happen" -restrictDataDefn _ (XHsDataDefn _) = error "restrictDataDefn" restrictCons :: [Name] -> [LConDecl GhcRn] -> [LConDecl GhcRn] restrictCons names decls = [ L p d | L p (Just d) <- map (fmap keep) decls ] @@ -201,7 +200,6 @@ restrictCons names decls = [ L p d | L p (Just d) <- map (fmap keep) decls ] field_avail :: LConDeclField GhcRn -> Bool field_avail (L _ (ConDeclField _ fs _ _)) = all (\f -> extFieldOcc (unLoc f) `elem` names) fs - field_avail (L _ (XConDeclField nec)) = noExtCon nec field_types flds = [ t | ConDeclField _ _ t _ <- flds ] keep _ = Nothing |