Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated error messages #83

Open
marcellussiegburg opened this issue Jul 1, 2019 · 0 comments
Open

Duplicated error messages #83

marcellussiegburg opened this issue Jul 1, 2019 · 0 comments
Labels

Comments

@marcellussiegburg
Copy link

When running the Interpreter error messages occur twice.

For instance considering the following file Test.hs.

module Test where
import Prelude

main :: IO ()
main = do hSetBuffering stdout NoBuffering
         putStr "This leads to an error"

When calling the interpreter within the terminal in the following way:

$ stack ghci
Using main module: 1. Package `test' component exe:test-exe with main-is file: /private/tmp/test/app/Main.hs
Building all executables for `test' once. After a successful build of all of them, only specified executables will be rebuilt.
test-0.1.0.0: configure (lib + exe)
Configuring test-0.1.0.0...
test-0.1.0.0: initial-build-steps (lib + exe)
The following GHC options are incompatible with GHCi and have not been passed to it: -threaded -O2
Configuring GHCi with the following packages: test
GHCi, version 8.6.5: http://www.haskell.org/ghc/  :? for help
[1 of 2] Compiling Lib              ( Lib.hs, interpreted )
[2 of 2] Compiling Main             ( /private/tmp/test/app/Main.hs, interpreted )
Ok, two modules loaded.
Loaded GHCi configuration from /private/var/folders/0k/rhm0fs9j0m9g0syf1rh5nmx40000gn/T/haskell-stack-ghci/56899571/ghci-script
*Main Lib> :set -package hint
package flags have changed, resetting and loading new packages...
Prelude> :m +Language.Haskell.Interpreter
Prelude Language.Haskell.Interpreter> :{
Prelude Language.Haskell.Interpreter| compiler :: MonadInterpreter m => [String] -> m ()
Prelude Language.Haskell.Interpreter| compiler modules = do
Prelude Language.Haskell.Interpreter|   set [installedModulesInScope := False]
Prelude Language.Haskell.Interpreter|   loadModules modules
Prelude Language.Haskell.Interpreter|   setTopLevelModules modules
Prelude Language.Haskell.Interpreter| :}
Prelude Language.Haskell.Interpreter> runInterpreter (compiler ["Test"])

The response contains the (correct) error message duplicated:

Left (WontCompile [GhcError {errMsg = "Test.hs:5:8: error:\n    Unexpected do block in function application:\n        do hSetBuffering stdout NoBuffering\n    You could write it with parentheses\n    Or perhaps you meant to enable BlockArguments?"},GhcError {errMsg = "Test.hs:5:8: error:\n    Unexpected do block in function application:\n        do hSetBuffering stdout NoBuffering\n    You could write it with parentheses\n    Or perhaps you meant to enable BlockArguments?"}])
@gelisam gelisam added the bug label Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants