[GHC] #13010: module imports form a cycle instead of failing to parse

GHC ghc-devs at haskell.org
Tue Dec 20 03:47:24 UTC 2016


#13010: module imports form a cycle instead of failing to parse
-------------------------------------+-------------------------------------
           Reporter:  MarcelineVQ    |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Some issue of parsing is causing certain module imports not to respect the
 proper format for a module name:

 `modid → {conid .} conid (modules)`

 A module import ending in numbers or a dot may be treated as if the . or
 .<numbers> weren't there. I would expect these to be parse errors instead
 of falling back to their 'parent', that's surely vague so here's examples.

 Minimally:

 `echo "module Lib where import Lib. " > test.hs && ghc test.hs`

 `echo "module Lib where import Lib.123 " > test.hs && ghc test.hs`

 Will both result in:

 {{{
 Module imports form a cycle:
   module ‘Lib’ (test.hs) imports itself
 }}}

 This is an error because it's not importing itself, it's importing Lib. or
 Lib.123 which are invalid module names.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13010>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list