Commit f602f4a6 authored by eir@cis.upenn.edu's avatar eir@cis.upenn.edu
Browse files

Fix printing of "kind" vs. "type"

This is as reported in #11471, though it's not the focus of that
ticket.

test case: polykinds/KindVType
parent aade1112
......@@ -1170,16 +1170,8 @@ uType origin t_or_k orig_ty1 orig_ty2
-- See Note [Mismatched type lists and application decomposition]
| tc1 == tc2, length tys1 == length tys2
= ASSERT2( isGenerativeTyCon tc1 Nominal, ppr tc1 )
do { cos <- zipWith3M (uType origin) t_or_ks tys1 tys2
do { cos <- zipWithM (uType origin t_or_k) tys1 tys2
; return $ mkTyConAppCo Nominal tc1 cos }
where
bndrs = tyConBinders tc1
t_or_ks = case t_or_k of
KindLevel -> repeat KindLevel
TypeLevel -> map (\bndr -> if isNamedBinder bndr
then KindLevel
else TypeLevel) bndrs ++
repeat TypeLevel
go (LitTy m) ty@(LitTy n)
| m == n
......
module KindVType where
-- test printing of "type" in output, not "kind"
import Data.Proxy
foo :: Proxy Maybe
foo = (Proxy :: Proxy Int)
KindVType.hs:8:8: error:
• Couldn't match type ‘*’ with ‘* -> *’
Expected type: Proxy Maybe
Actual type: Proxy Int
• In the expression: (Proxy :: Proxy Int)
In an equation for ‘foo’: foo = (Proxy :: Proxy Int)
......@@ -145,3 +145,4 @@ test('T11399', normal, compile_fail, [''])
test('T11611', normal, compile_fail, [''])
test('T11648', normal, compile, [''])
test('T11648b', normal, compile_fail, [''])
test('KindVType', normal, compile_fail, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment