Skip to content
Snippets Groups Projects
Commit c165f079 authored by sheaf's avatar sheaf Committed by Marge Bot
Browse files

Add testcase for #23192

This issue around solving of constraints arising from superclass
expansion using other constraints also borned from superclass expansion
was the topic of commit aed1974e. That commit made sure we don't emit
a "redundant constraint" warning in a situation in which removing the
constraint would cause errors.

Fixes #23192
parent 7c16f3be
No related branches found
No related tags found
No related merge requests found
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -Werror=redundant-constraints #-}
module EventThing where
class Monad m => Event m where
thingsForEvent :: m [Int]
class Monad m => Thingy m where
thingies :: m [Int]
-- Check that we don't get a redundant constraint warning for "Monad m".
-- See #19690.
instance (Monad m, Event m) => Thingy m where
thingies = thingsForEvent
...@@ -870,3 +870,4 @@ test('T21443', normal, compile, ['']) ...@@ -870,3 +870,4 @@ test('T21443', normal, compile, [''])
test('QualifiedRecordUpdate', test('QualifiedRecordUpdate',
[ extra_files(['QualifiedRecordUpdate_aux.hs']) ] [ extra_files(['QualifiedRecordUpdate_aux.hs']) ]
, multimod_compile, ['QualifiedRecordUpdate', '-v0']) , multimod_compile, ['QualifiedRecordUpdate', '-v0'])
test('T23192', normal, compile, [''])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment