Opened 17 months ago

Closed 6 months ago

#11592 closed bug (fixed)

Self-kinded type variable accepted

Reported by: simonpj Owned by: johnleo
Priority: normal Milestone: 8.2.1
Component: Compiler Version: 7.10.3
Keywords: TypeInType Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D2914
Wiki Page:

Description

Found when chasing #11407

data T (a::a) = Blah -- Accepted

data S (b :: a) a = ...
  -- Rejected with: variable ‘a’ used as a kind variable before being bound
  --                as a type variable. Perhaps reorder your variables?

But T should be rejected too, for the same reason as S

Change History (6)

comment:1 Changed 17 months ago by simonpj

Keywords: TypeInType added
Summary: Self-kinded type varialbe acceptedSelf-kinded type variable accepted

comment:2 Changed 11 months ago by johnleo

Owner: set to johnleo

comment:3 Changed 7 months ago by johnleo

Differential Rev(s): D2914

comment:4 Changed 7 months ago by johnleo

Differential Rev(s): D2914Phab:D2914

comment:5 Changed 6 months ago by Ben Gamari <ben@…>

In 8a76d32e/ghc:

Check that type variable does not reference itself in its kind signature

This fixes #11592.

Test Plan: validate

Reviewers: simonpj, austin, bgamari, goldfire

Reviewed By: goldfire

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2914

GHC Trac Issues: #11592

comment:6 Changed 6 months ago by bgamari

Milestone: 8.2.1
Resolution: fixed
Status: newclosed

Thanks John!

Note: See TracTickets for help on using tickets.