Skip to content

"info" command requires both "main" and "module" specified #22

@edkolev

Description

@edkolev

Hi, and thanks for this project!

I noticed the "info" command cannot be executed without both "main" and "module" specified.

To reproduce:

  1. Add file c.hs

    f = 'c'
  2. run hdevtools info

    hdevtools admin --stop-server
    hdevtools admin --start-server
    hdevtools info c.hs f
  3. get error, instead of the correct type f :: Char

    hs:1:1:
        The IO action ‘main’ is not defined in module ‘Main’
    Error loading targets
    

BTW GHCi can guess the type of f:

echo ":type f" | ghci c.hs
GHCi, version 7.10.3: http://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Main             ( c.hs, interpreted )
Ok, modules loaded: Main.
ghci> f :: Char

To get the type of f, both "main" and "module" need to be defined:

  1. add file a.hs

    module Main where
    
    main = undefined
    
    f = 'a'
  2. run info (same commands as in 2. above)

  3. get correct output

    f :: Char       -- Defined at /private/tmp/a.hs:5:1
    

I haven't checked if the type command has this same issue.

This version of hdevtools is:

hdevtools --version
hdevtools: version 0.1.3.1 (ghc-7.10.3-x86_64-darwin, cabal-1.22.5.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions