Skip to content

Non-existant variable in error message in type family instance

Summary

In an error message about unused variables in type family instance, GHC mentions a variable, that doesn't exist in source code.

Steps to reproduce

{-# LANGUAGE TypeFamilies, ExplicitForAll, PolyKinds #-}
module Bug where

type family F
type instance forall a. F = ()

This code produces the following error message:

    • Type variables ‘k’, ‘a’ are bound by a forall,
        but not used in the family instance

What is k? Why GHC mentions it?

Expected behavior

Type variable ‘a’ is bound by a forall...

Environment

  • GHC version used:
    • Versions [8.8 .. HEAD] report ‘k’, ‘a’
    • 8.6 cannot parse this syntax.
Edited by sheaf
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information