You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ghc-8.6, when using the GHC API, requires that plugins be initialized explicitly for each module. (Previous versions of the API initialized them automatically).
See for example: sol/doctest#224
The following file that uses ghc-typelits-knownnat can reproduce the problem. It builds fine with ghc-8.6, but fails to load in the indexer. I applied a patch on our internal codebase similar to the above doctest PR, but wasn't sure how to test it in this codebase given the external dependency requirement.
{-# OPTIONS_GHC -fplugin=GHC.TypeLits.KnownNat.Solver #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
module Main (main) where
import Control.Exception (assert)
import Data.Proxy
import GHC.TypeLits
-- | Requires ghc-typelits-knownnat to solve its constraints:
plusOne :: forall n . KnownNat n => Proxy n -> Integer
plusOne _ = natVal (Proxy :: Proxy (n + 1))
two :: Integer
two = plusOne (Proxy :: Proxy 1)
main :: IO ()
main = assert (2 == two) $ return ()
The text was updated successfully, but these errors were encountered:
ghc-8.6, when using the GHC API, requires that plugins be initialized explicitly for each module. (Previous versions of the API initialized them automatically).
See for example:
sol/doctest#224
The following file that uses
ghc-typelits-knownnat
can reproduce the problem. It builds fine with ghc-8.6, but fails to load in the indexer. I applied a patch on our internal codebase similar to the above doctest PR, but wasn't sure how to test it in this codebase given the external dependency requirement.The text was updated successfully, but these errors were encountered: