Opened 3 years ago

Closed 3 years ago

#9997 closed bug (fixed)

"A module cannot import itself"-regression

Reported by: hvr Owned by: simonpj
Priority: highest Milestone: 7.10.1
Component: Compiler Version: 7.10.1-rc1
Keywords: regression Cc: ezyang
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: module/T9997
Blocked By: Blocking:
Related Tickets: #9032 Differential Rev(s):
Wiki Page:

Description

The following module could be compiled with GHC 7.8.4 and older, but fails with GHC 7.10:

{-# LANGUAGE PackageImports #-}

module Control.DeepSeq where

import "deepseq" Control.DeepSeq
$ ghci -Wall DeepSeq.hs
GHCi, version 7.10.0.20141227: http://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Control.DeepSeq  ( DeepSeq.hs, interpreted )

DeepSeq.hs:5:1: A module cannot import itself: Control.DeepSeq
Failed, modules loaded: none.
λ:2> 

Change History (5)

comment:1 Changed 3 years ago by hvr

Owner: set to simonpj

This seems to be an unintended side-effect of edd233acc19d269385c1a870829e0916a3df8e88

comment:2 Changed 3 years ago by hvr

comment:3 Changed 3 years ago by Simon Peyton Jones <simonpj@…>

In fb7c311711c8851d0de1e40231150ad999ae9c2b/ghc:

Repsect the package name when checking for self-import

Fixes Trac #9997.

In doing this I tripped across the specialness of "this" in
PackageImports.  The magic constant (fsLit "this") is scattered across
the compiler and ought to be put in one place.  But where?

comment:4 Changed 3 years ago by simonpj

Status: newmerge
Test Case: module/T9997T

I believe I have fixed this.

Merge to 7.10.

comment:5 Changed 3 years ago by hvr

Resolution: fixed
Status: mergeclosed
Test Case: module/T9997Tmodule/T9997
Note: See TracTickets for help on using tickets.