Opened 20 months ago

Closed 18 months ago

Last modified 18 months ago

#11512 closed bug (fixed)

An unwritten kind variable is "specified", when it shouldn't be.

Reported by: goldfire Owned by: goldfire
Priority: normal Milestone: 8.0.1
Component: Compiler Version: 8.1
Keywords: TypeApplications Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: typecheck/should_compile/T11512
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

This fails:

{-# LANGUAGE PolyKinds, TypeApplications, ScopedTypeVariables #-}

module Bug where

import Data.Proxy

class C a where
  foo :: Proxy a

bar :: forall a. C a => Proxy a
bar = foo @a

But it really should work, because the invisible kind variable to class C should not be available for type application. On the last line, foo @_ @a works, when you explicitly instantiate the kind variable. Also, saying :t foo in GHCi shows the specified kind variable.

Will fix. At some point.

Change History (6)

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

In f4f315a/ghc:

Fix #11512 by getting visibility right for methods

Test case: typecheck/should_compile/T11512

comment:2 Changed 19 months ago by goldfire

Status: newmerge
Test Case: typecheck/should_compile/T11512

comment:3 Changed 19 months ago by goldfire

Milestone: 8.0.1

comment:4 Changed 18 months ago by bgamari

Last edited 18 months ago by bgamari (previous) (diff)

comment:5 Changed 18 months ago by Richard Eisenberg <eir@…>

In 35e93797/ghc:

Track specified/invisible more carefully.

In particular, this allows correct tracking of specified/invisible
for variables in Haskell98 data constructors and in pattern synonyms.
GADT-syntax constructors are harder, and are left until #11721.

This was all inspired by Simon's comments to my fix for #11512,
which this subsumes.

Test case: ghci/scripts/TypeAppData

[skip ci]  (The test case fails because of an unrelated problem
fixed in the next commit.)

comment:6 Changed 18 months ago by bgamari

Resolution: fixed
Status: mergeclosed
Last edited 18 months ago by bgamari (previous) (diff)
Note: See TracTickets for help on using tickets.