Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
55e7ab12
Commit
55e7ab12
authored
Jun 08, 2014
by
gintas
Committed by
Joachim Breitner
Jul 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not print the result of 'main' after invoking ':main' (fixes #9086).
parent
fa8553de
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
3 deletions
+12
-3
ghc/InteractiveUI.hs
ghc/InteractiveUI.hs
+4
-3
testsuite/tests/ghc-e/should_run/Makefile
testsuite/tests/ghc-e/should_run/Makefile
+2
-0
testsuite/tests/ghc-e/should_run/T9086.hs
testsuite/tests/ghc-e/should_run/T9086.hs
+1
-0
testsuite/tests/ghc-e/should_run/all.T
testsuite/tests/ghc-e/should_run/all.T
+1
-0
testsuite/tests/ghci/scripts/T9086b.script
testsuite/tests/ghci/scripts/T9086b.script
+2
-0
testsuite/tests/ghci/scripts/T9086b.stdout
testsuite/tests/ghci/scripts/T9086b.stdout
+1
-0
testsuite/tests/ghci/scripts/all.T
testsuite/tests/ghci/scripts/all.T
+1
-0
No files found.
ghc/InteractiveUI.hs
View file @
55e7ab12
...
...
@@ -1141,9 +1141,10 @@ runMain s = case toArgs s of
Left
err
->
liftIO
(
hPutStrLn
stderr
err
)
Right
args
->
do
dflags
<-
getDynFlags
case
mainFunIs
dflags
of
Nothing
->
doWithArgs
args
"main"
Just
f
->
doWithArgs
args
f
let
main
=
fromMaybe
"main"
(
mainFunIs
dflags
)
-- Wrap the main function in 'void' to discard its value instead
-- of printing it (#9086). See Haskell 2010 report Chapter 5.
doWithArgs
args
$
"Control.Monad.void ("
++
main
++
")"
-----------------------------------------------------------------------------
-- :run
...
...
testsuite/tests/ghc-e/should_run/Makefile
View file @
55e7ab12
...
...
@@ -30,3 +30,5 @@ T3890:
T7299
:
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-ignore-dot-ghci
-e
"Control.Concurrent.threadDelay (1000 * 1000)"
T9086
:
'
$(TEST_HC)
'
$(TEST_HC_OPTS)
-ignore-dot-ghci
-e
":main"
T9086.hs
testsuite/tests/ghc-e/should_run/T9086.hs
0 → 100644
View file @
55e7ab12
main
=
return
"this should not be printed"
testsuite/tests/ghc-e/should_run/all.T
View file @
55e7ab12
...
...
@@ -14,3 +14,4 @@ test('T2228',
test
('
T2636
',
req_interp
,
run_command
,
['
$MAKE --no-print-directory -s T2636
'])
test
('
T3890
',
req_interp
,
run_command
,
['
$MAKE --no-print-directory -s T3890
'])
test
('
T7299
',
req_interp
,
run_command
,
['
$MAKE --no-print-directory -s T7299
'])
test
('
T9086
',
req_interp
,
run_command
,
['
$MAKE --no-print-directory -s T9086
'])
testsuite/tests/ghci/scripts/T9086b.script
0 → 100644
View file @
55e7ab12
let main = do { putStrLn "hello"; return "discarded" }
:main
testsuite/tests/ghci/scripts/T9086b.stdout
0 → 100644
View file @
55e7ab12
hello
testsuite/tests/ghci/scripts/all.T
View file @
55e7ab12
...
...
@@ -175,3 +175,4 @@ test('T8931', normal, ghci_script, ['T8931.script'])
test
('
T8959
',
normal
,
ghci_script
,
['
T8959.script
'])
test
('
T8959b
',
expect_broken
(
8959
),
ghci_script
,
['
T8959b.script
'])
test
('
T9181
',
normal
,
ghci_script
,
['
T9181.script
'])
test
('
T9086b
',
normal
,
ghci_script
,
['
T9086b.script
'])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment