Ticket #4401 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

Functional dependencies regression

Reported by: rl Owned by: simonpj
Priority: highest Milestone: 7.0.1
Component: Compiler Version: 7.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: T4401 Blocked By:
Blocking: Related Tickets:

Description

Testcase:

{-# LANGUAGE FlexibleInstances, UndecidableInstances, MultiParamTypeClasses, FunctionalDependencies #-}
module Foo where

class Mul x y z | x y -> z
class IsType a
class IsType a => IsSized a s | a -> s

data Array n a = Array
instance IsSized a s => IsType (Array n a)
instance (IsSized a s, Mul n s ns) => IsSized (Array n a) ns

ghc-7.0.0.20101014 rejects this with:

    Couldn't match type `s' with `s1'
      because this skolem type variable would escape: `s1'
    This skolem is bound by the instance declaration
    In the instance declaration for `IsSized (Array n a) ns'

ghc-7.0.0.20101005 and all previous versions accept it. This is from the llvm package, so is fairly critical.

Change History

Changed 3 years ago by igloo

  • owner set to simonpj
  • priority changed from normal to highest
  • milestone set to 7.0.1

Changed 3 years ago by igloo

  • testcase set to T4401

Fixed in HEAD by:

Fri Oct 15 14:08:18 BST 2010  simonpj@microsoft.com
  * Fix Trac #4401: meta-tyvars allocated by the constraint solver are always touchable

but this causes break001(ghci) and break006(ghci) to fail, so I haven't merged it yet.

Changed 3 years ago by simonpj

I'm working on break001/6. Simon

Changed 3 years ago by simonpj

  • status changed from new to closed
  • resolution set to fixed

This is fixed now. Test is in place.

Changed 3 years ago by rl

This hasn't been merged yet. Should the status be changed to merge? We might forget otherwise.

Changed 3 years ago by simonpj

  • status changed from closed to merge

Changed 3 years ago by igloo

  • status changed from merge to closed

The patch above has been merged, as has the test. Please reopen if there's another patch that needs to be merged for this ticket.

Changed 3 years ago by rl

That's weird. LLVM builds for me with the head snapshot from Oct 19 but not with the branch snapshot from the same day. Or perhaps I messed up. I'll investigate.

Changed 3 years ago by igloo

It was merged on the 19th, after the nightly builds started:  http://www.haskell.org/pipermail/cvs-ghc/2010-October/056892.html

Changed 3 years ago by rl

That explains it then. Sorry about the noise. Thanks!

Note: See TracTickets for help on using tickets.