summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts/T8353.script
blob: 7e68cee238e10f9e310520dcc772d367fbcf3819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
:l shell.hs
:def shell (\s -> do shell s; return "")
:l

:shell cp Defer03_before.hs Defer03.hs

-- Test :load! and :reload!

-- main is independent of functions with type errors and thus
-- executable after load
-- warnings on type errors are emitted nevertheless
:load!   Defer03

-- fails to load module due to type errors
:load    Defer03

-- succeeds again to load module
:reload!

-- also succeeds, because the module has not been changed since load
:reload

-- now, after modifying, reloading should fail
:shell echo "-- an extra comment so that the hash changes" >> Defer03.hs
:reload

-- using the deferred version of reload, loading should succeed again
:reload!

:shell rm Defer03.hs