Opened 4 years ago

Closed 4 years ago

#11246 closed bug (fixed)

Regression typechecking type synonym which includes `Any`.

Reported by: mpickering Owned by: goldfire
Priority: highest Milestone: 8.0.1
Component: Compiler (Type checker) Version: 8.0.1-rc2
Keywords: TypeInType Cc: asr
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHC rejects valid program Test Case: typecheck/should_compile/T11246
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by bgamari)

module Foo where

import GHC.Exts

type Key a = Any

produces the error message on HEAD but compiles on 7.8.3 and 7.10.1 (thanks to Reid for testing).

unsafeany.hs:5:1: error:
    • The type family ‘Any’ should have no arguments, but has been given none
    • In the type synonym declaration for ‘Key’
Failed, modules loaded: none.

Change History (11)

comment:1 Changed 4 years ago by mpickering

Description: modified (diff)

Omer comments that the bug could be caused by levity polymorphism.

mpickering: I don't quite understand what changes need to be made, but if you look at anyTyCon in TysPrim.hs you'll see that it's not updated after Richard's patch. I'm just guessing that this may be the reason because tuple tycons are changed to update the kind arguments, for example.

comment:2 Changed 4 years ago by goldfire

Owner: set to goldfire

I doubt it's levity polymorphism, but I feel quite confident I'm the culprit. Will look into this.

comment:3 Changed 4 years ago by hvr

Milestone: 8.0.1
Priority: normalhigh

comment:4 Changed 4 years ago by simonpj

Keywords: TypeInType added

comment:5 Changed 4 years ago by asr

Cc: asr added

comment:6 Changed 4 years ago by asr


comment:7 Changed 4 years ago by asr

Priority: highhighest

This issue will block hashtables for supporting GHC 8.0.1 (and hashtables will block Agda).

comment:8 Changed 4 years ago by bgamari

Component: CompilerCompiler (Type checker)
Description: modified (diff)
Type of failure: None/UnknownGHC rejects valid program

comment:9 Changed 4 years ago by Richard Eisenberg <eir@…>

In 489e6ab5/ghc:

Fix #11246.

We have to instantiate any invisible arguments to type families
right away. This is now done in tcTyCon in TcHsType.

testcase: typecheck/should_compile/T11246

comment:10 Changed 4 years ago by goldfire

Status: newmerge
Test Case: typecheck/should_compile/T11246

comment:11 Changed 4 years ago by bgamari

Resolution: fixed
Status: mergeclosed
Note: See TracTickets for help on using tickets.