
#11247: Weird error from running runghc on an invalid input filename -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: runghc/T11247 Blocked By: | Blocking: Related Tickets: #7765 | Differential Rev(s): Phab:D1678 Wiki Page: | -------------------------------------+------------------------------------- Comment (by thomie): Just putting down some notes here: * `runghc random.` calls `ghc -e :main random.` * The function function `partition_args` in `ghc/Main.hs` decides that `random.` doesn't look like a source file input. * So it becomes a linker input (`ldInputs`). * But then `classifyLdInput` in `compiler/main/Linker.hs` decides it isn't a suitable linker input either, and ignores it. From 948e7f388748078a8d9a324b284da7c4029f7060: In GHCi & Template Haskell, give a warning for things mentioned on the command line that we don't recognise, and then ignore them. In batch mode, these are still passed to the linker as before. Indeed, `ghc random.` shows an error produced by the linker: `gcc: error: random.: No such file or directory` -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11247#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler