Commit 45d33f35 authored by Edward Z. Yang's avatar Edward Z. Yang

Better test coverage for module reexports in signatures.

Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 0c333c89
......@@ -45,6 +45,8 @@ test('bkp50', normal, backpack_compile, [''])
test('bkp51', normal, backpack_compile, [''])
test('bkp52', normal, backpack_compile, [''])
test('bkp53', normal, backpack_compile, [''])
test('bkp54', normal, backpack_compile, [''])
test('bkp55', normal, backpack_compile, [''])
test('T13140', normal, backpack_compile, [''])
test('T13149', expect_broken(13149), backpack_compile, [''])
......
unit q where
signature A (module N) where
import qualified Data.Bool as N
unit p where
dependency signature q[A=<A>]
signature A (module A, module Data.Word) where
import Data.Word
module M where
import qualified A
x = A.otherwise
type T = A.Word
[1 of 2] Processing q
[1 of 1] Compiling A[sig] ( q/A.hsig, nothing )
[2 of 2] Processing p
[1 of 2] Compiling A[sig] ( p/A.hsig, nothing )
[2 of 2] Compiling M ( p/M.hs, nothing )
unit p where
signature A where
p :: Int
unit q where
dependency signature p[A=<B>]
signature B (module B) where
q :: Int
module M where
import B
f = p + q
[1 of 2] Processing p
[1 of 1] Compiling A[sig] ( p/A.hsig, nothing )
[2 of 2] Processing q
[1 of 2] Compiling B[sig] ( q/B.hsig, nothing )
[2 of 2] Compiling M ( q/M.hs, nothing )
......@@ -43,3 +43,5 @@ test('bkpfail44', normal, backpack_compile_fail, [''])
test('bkpfail45', normal, backpack_compile_fail, [''])
test('bkpfail46', normal, backpack_compile_fail, [''])
test('bkpfail47', normal, backpack_compile_fail, [''])
test('bkpfail48', normal, backpack_compile_fail, [''])
test('bkpfail49', normal, backpack_compile_fail, [''])
unit q where
signature A (module Data.Bool) where
import Data.Bool
unit p where
dependency signature q[A=<A>]
signature A (module Data.Bool) where
-- This should not work: module is mandatory
[1 of 2] Processing q
[1 of 1] Compiling A[sig] ( q/A.hsig, nothing )
[2 of 2] Processing p
[1 of 1] Compiling A[sig] ( p/A.hsig, nothing )
bkpfail48.bkp:6:18: error:
• The export item `module Data.Bool' is not imported
• while merging the signatures from:
• q[A=<A>]:A
• ...and the local signature for A
unit p where
signature A (module Data.Bool) where
import Data.Bool
unit q where
dependency signature p[A=<A>]
signature A (module Data.Bool) where
import Data.Bool ()
module M where
import qualified A
x = A.True -- should not exist!
[1 of 2] Processing p
[1 of 1] Compiling A[sig] ( p/A.hsig, nothing )
[2 of 2] Processing q
[1 of 2] Compiling A[sig] ( q/A.hsig, nothing )
[2 of 2] Compiling M ( q/M.hs, nothing )
bkpfail49.bkp:11:13: error:
Not in scope: data constructor ‘A.True’
Module ‘A’ does not export ‘True’.
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