#11241 closed bug (fixed)

Kind-level PartialTypeSignatures causes internal error

Reported by: adamgundry Owned by: goldfire
Priority: normal Milestone: 8.0.1
Component: Compiler (Type checker) Version: 7.11
Keywords: TypeInType Cc: goldfire
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHC rejects valid program Test Case: dependent/should_compile/T11241
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Consider the following module:

{-# LANGUAGE ExplicitForAll, KindSignatures, PartialTypeSignatures #-}

foo :: forall (a :: _) . a -> a 
foo = id 

In HEAD, this fails with an internal errror:

    • GHC internal error: ‘_’ is not in scope during type checking, but it passed the renamer
      tcl_env of environment: []
    • In the kind ‘_’
      In the type signature:
        foo :: forall (a :: _). a -> a

I would expect it to succeed and figure out that the wildcard is *.

Change History (6)

comment:1 Changed 22 months ago by goldfire

Owner: set to goldfire

I'm on it.

comment:2 Changed 21 months ago by RyanGlScott

This might possibly be related: running the following command in GHCi yields an error:

$ ghc/inplace/bin/ghc-stage2 --interactive
GHCi, version 7.11.20151219: http://www.haskell.org/ghc/  :? for help
λ> :set -XTypeInType -XRankNTypes
λ> :kind! forall (a :: k). 'Just a

<interactive>:1:14: error:
    • GHC internal error: ‘k’ is not in scope during type checking, but it passed the renamer
      tcl_env of environment: []
    • In the kind ‘k’
      In the type ‘forall (a :: k). Just a’

Yet putting it into a module makes it compile without issues:

{-# LANGUAGE RankNTypes, TypeInType #-}
module InternalError where

type T = forall (a :: k). 'Just a

comment:3 Changed 21 months ago by simonpj

Keywords: TypeInType added

comment:4 Changed 19 months ago by Richard Eisenberg <eir@…>

In 43468fe3/ghc:

Fix #11241.

When renaming a type, now looks for wildcards in bound variables'
kinds.

testcase: dependent/should_compile/T11241

comment:5 Changed 19 months ago by goldfire

Status: newmerge
Test Case: dependent/should_compile/T11241

comment:6 Changed 19 months ago by bgamari

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