diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-05-13 00:10:47 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-08-21 00:53:21 -0700 |
commit | 8fd184887e7c240c7089367c6f737fa66cf409fc (patch) | |
tree | 98e1c3a290e2495bcfcc7ffd0339e98940607134 /testsuite | |
parent | 5a8fa2e662fce9ef03f0ec7891d7f81740e630bc (diff) | |
download | haskell-8fd184887e7c240c7089367c6f737fa66cf409fc.tar.gz |
Retypecheck both before and after finishing hs-boot loops in --make.
Summary:
This makes ghc --make's retypecheck behavior more in line
with ghc -c, which is able to tie the knot as we are typechecking.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2213
GHC Trac Issues: #12035
Diffstat (limited to 'testsuite')
5 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T12035.hs b/testsuite/tests/typecheck/should_fail/T12035.hs new file mode 100644 index 0000000000..87e20ff07c --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T12035.hs @@ -0,0 +1,10 @@ +module T12035 where +import T12035a +type T = Bool +y = f True + +-- This should error that 'type T = Int' doesn't match 'data T', +-- NOT that f expects argument of type T but got Bool. +-- +-- NB: This test will start passing if we allow abstract data +-- types to be implemented using type synonyms. diff --git a/testsuite/tests/typecheck/should_fail/T12035.hs-boot b/testsuite/tests/typecheck/should_fail/T12035.hs-boot new file mode 100644 index 0000000000..1eb9094870 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T12035.hs-boot @@ -0,0 +1,2 @@ +module T12035 where +data T diff --git a/testsuite/tests/typecheck/should_fail/T12035.stderr b/testsuite/tests/typecheck/should_fail/T12035.stderr new file mode 100644 index 0000000000..7086785d6d --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T12035.stderr @@ -0,0 +1,6 @@ + +T12035.hs-boot:2:1: error: + Type constructor âTâ has conflicting definitions in the module + and its hs-boot file + Main module: type T = Bool + Boot file: abstract T diff --git a/testsuite/tests/typecheck/should_fail/T12035a.hs b/testsuite/tests/typecheck/should_fail/T12035a.hs new file mode 100644 index 0000000000..37d6bc042a --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T12035a.hs @@ -0,0 +1,4 @@ +module T12035a where +import {-# SOURCE #-} T12035 +f :: T -> T +f x = x diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index b064c56a01..37d74c6841 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -418,6 +418,8 @@ test('T11947a', normal, compile_fail, ['']) test('T11948', normal, compile_fail, ['']) test('T11990a', normal, compile_fail, ['']) test('T11990b', normal, compile_fail, ['']) +test('T12035', extra_clean(['T12035.hi-boot', 'T12035.o-boot', 'T12035a.hi', 'T12035a.o']), + multimod_compile_fail, ['T12035', '-v0']) test('T12063', [ expect_broken(12063), extra_clean(['T12063.hi-boot', 'T12063.o-boot', 'T12063a.hi', 'T12063a.o']) ], multimod_compile_fail, ['T12063', '-v0']) test('T11974b', normal, compile_fail, ['']) |