Skip to content

Core lint error when compiling linear-generics with GHC 9.2.5

Summary

linear-generics-0.2 fails to compile with -dcore-lint

Steps to reproduce

$ cabal get linear-generics-0.2
$ cat > cabal.project << EOF
packages: .
package linear-generics
  ghc-options: -dcore-lint
EOF
$ cabal build
Click to expand
src/Generics/Linear/Class.hs:200:1: warning:
    Multiplicity of variable does not agree with its context
    fa_a2N2
    MultMul n_a5LH m_a5LE
    Annotation: MultMul n_a5LH (MultMul n_a5LH m_a5LE)
    In the RHS of unMP1 :: forall {k} (m :: Multiplicity) (f :: k -> *)
                                  (a :: k) (n :: Multiplicity).
                           MP1 m f a %n -> f a
    In the body of lambda with binder k_a5LD :: *
    In the body of lambda with binder m_a5LE :: Multiplicity
    In the body of lambda with binder f_a5LF :: k_a5LD -> *
    In the body of lambda with binder a_a5LG :: k_a5LD
    In the body of lambda with binder n_a5LH :: Multiplicity
    In the body of lambda with binder ds_d6V3 :: MP1
                                                   m_a5LE f_a5LF a_a5LG
    In a case alternative: (MP1 fa_a2N2 :: f_a5LF a_a5LG)
    In the pattern of a case alternative: (MP1 fa_a2N2 :: f_a5LF
                                                            a_a5LG)
    Substitution: [TCvSubst
                     In scope: InScope {k_a5LD m_a5LE f_a5LF a_a5LG n_a5LH}
                     Type env: [a5LD :-> k_a5LD, a5LE :-> m_a5LE, a5LF :-> f_a5LF,
                                a5LG :-> a_a5LG, a5LH :-> n_a5LH]
                     Co env: []]
src/Generics/Linear/Class.hs:200:1: warning:
    Multiplicity of variable does not agree with its context
    fa_a2N2
    MultMul n_a5LH m_a5LE
    Annotation: MultMul n_a5LH (MultMul n_a5LH m_a5LE)
    In the RHS of unMP1 :: forall {k} (m :: Multiplicity) (f :: k -> *)
                                  (a :: k) (n :: Multiplicity).
                           MP1 m f a %n -> f a
    In the body of lambda with binder k_a5LD :: *
    In the body of lambda with binder m_a5LE :: Multiplicity
    In the body of lambda with binder f_a5LF :: k_a5LD -> *
    In the body of lambda with binder a_a5LG :: k_a5LD
    In the body of lambda with binder n_a5LH :: Multiplicity
    In the body of lambda with binder ds_d6V3 :: MP1
                                                   m_a5LE f_a5LF a_a5LG
    In a case alternative: (MP1 fa_a2N2 :: f_a5LF a_a5LG)
    In the pattern of a case alternative: (MP1 fa_a2N2 :: f_a5LF
                                                            a_a5LG)
    Substitution: [TCvSubst
                     In scope: InScope {k_a5LD m_a5LE f_a5LF a_a5LG n_a5LH}
                     Type env: [a5LD :-> k_a5LD, a5LE :-> m_a5LE, a5LF :-> f_a5LF,
                                a5LG :-> a_a5LG, a5LH :-> n_a5LH]
                     Co env: []]
## Expected behavior

Environment

  • GHC version used: 9.2.5
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information