Commit 8f49f6de authored by rwbarton's avatar rwbarton Committed by Ben Gamari
Browse files

Add a failing test for #13102

Test Plan: harbormaster

Reviewers: austin, ezyang, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #13102
parent a8c81f3c
module A where
import O
x _ = 1 -- Generate a silly warning, so we know A was really compiled
x _ = 2 -- (and thus the reason B fails is that the bug is fixed)
module B where
import F
f :: F Int -> Bool
f = id
include $(TOP)/mk/
include $(TOP)/mk/
cd orphan && "$(TEST_HC)" -v0 --make Setup.hs
cd orphan && ./Setup configure -v0 --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=../$(LOCAL_PKGCONF)
cd orphan && ./Setup build -v0
cd orphan && ./Setup register -v0 --inplace
! "$(TEST_HC)" $(TEST_HC_OPTS) -c A.hs B.hs -package-db $(LOCAL_PKGCONF)
A.hs:6:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant
In an equation for ‘x’: x _ = ...
B.hs:6:5: error:
• Couldn't match type ‘F Int’ with ‘Bool’
Expected type: F Int -> Bool
Actual type: Bool -> Bool
• In the expression: id
In an equation for ‘f’: f = id
# Test that we don't use a family instance that we didn't import
test('T13102', [expect_broken(13102),
extra_files(['A.hs', 'B.hs', 'orphan'])],
run_command, ['$MAKE -s --no-print-directory T13102'])
{-# LANGUAGE TypeFamilies #-}
module F where
type family F a :: *
{-# LANGUAGE TypeFamilies #-}
module O where
import F
type instance F Int = Bool
import Distribution.Simple
main = defaultMain
name: orphan
version: 1.0
exposed-modules: F, O
build-depends: base
build-type: Simple
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment