Update examples
This commit is contained in:
11
testsuite/hier/hier4/A.hs
Normal file
11
testsuite/hier/hier4/A.hs
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
-- now, the question is: is it possible to not depend on a module or
|
||||
-- package, but nonetheless have an orphan to it? this could cause
|
||||
-- problems....
|
||||
|
||||
module A where
|
||||
|
||||
import B
|
||||
|
||||
u :: Int
|
||||
u = undefined
|
4
testsuite/hier/hier4/B.hs
Normal file
4
testsuite/hier/hier4/B.hs
Normal file
@ -0,0 +1,4 @@
|
||||
module B where
|
||||
|
||||
import C () -- instances, to make available to those who use B
|
||||
|
12
testsuite/hier/hier4/C.hs
Normal file
12
testsuite/hier/hier4/C.hs
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
-- try to construct an orphan module == an instance decl-only module,
|
||||
-- that uses classes and types not defined in this module
|
||||
|
||||
module C (C) where
|
||||
|
||||
import D
|
||||
|
||||
instance C a => D (T a) where
|
||||
|
||||
class C a where
|
||||
|
6
testsuite/hier/hier4/D.hs
Normal file
6
testsuite/hier/hier4/D.hs
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
module D where
|
||||
|
||||
class D a where
|
||||
|
||||
data T a = T
|
12
testsuite/hier/hier4/Main.hs
Normal file
12
testsuite/hier/hier4/Main.hs
Normal file
@ -0,0 +1,12 @@
|
||||
module Main where
|
||||
|
||||
import System.Plugins
|
||||
|
||||
main = do
|
||||
|
||||
makeAll "A.hs" []
|
||||
|
||||
y <- load "A.o" ["."] [] "u"
|
||||
case y of
|
||||
LoadSuccess _ _ -> putStrLn $ "YES"
|
||||
LoadFailure e -> mapM_ putStrLn e
|
4
testsuite/hier/hier4/Makefile
Normal file
4
testsuite/hier/hier4/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
TEST= hier/hier4
|
||||
|
||||
TOP=../../..
|
||||
include ../../eval.mk
|
1
testsuite/hier/hier4/expected
Normal file
1
testsuite/hier/hier4/expected
Normal file
@ -0,0 +1 @@
|
||||
YES
|
Reference in New Issue
Block a user