Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,247
    • Issues 5,247
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 577
    • Merge requests 577
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #15702
Closed
Open
Issue created Oct 03, 2018 by Cheng Shao@TerrorJackDeveloper

"-main-is" flag is broken for recent ghc-head

Here is a minimal reproduction:

Main.hs:

main :: IO ()
main = putStrLn "Main"

Main2.hs:

module Main2 where

import Main

main2 :: IO ()
main2 = do
  putStrLn "Main2"
  main

Run ghc with something like /home/terrorjack/.stack/programs/x86_64-linux/ghc-8.7.20181003/bin/ghc -main-is Main2.main2 Main.hs Main2.hs, and it reports the following error:

[1 of 2] Compiling Main             ( Main.hs, Main.o )

Main.hs:1:1: error:
    Not in scope: ‘main2’
    Perhaps you meant ‘main’ (line 2)
  |
1 | main :: IO ()
  | ^

Meanwhile, the exact same flags work for ghc-8.6.1, and also a previous ghc-head build on d90946ce, so some accidental breakage might be in a recent commit.

Trac metadata
Trac field Value
Version 8.6.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking