Skip to content

AllowAmbiguousTypes doesn't work with UndecidableSuperClasses

Given the code below, test1 and test2 are the same except the former has an ambiguous type and the latter does not. The compiler rejects the former and accepts the latter.

{-# LANGUAGE UndecidableSuperClasses #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE TypeFamilies #-}

class A (T a) => A a where
    type T a

test1 :: forall a. A a => ()
test1 = ()

test2 :: A a => proxy a -> ()
test2 _ = ()
Trac metadata
Trac field Value
Version 8.0.1-rc3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information