Conflicts with Import error - New to D, trying to build a new project

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jan 25 13:22:49 PST 2015


On 01/25/2015 11:30 AM, Gan wrote:
> Here's a screenshot: http://cl.ly/image/2n282v0B1X2M
>
> The error is: /Users/Matt/Projects/spacecraft/source/Game/Game.d(0,0):
> Error: class Game.Game.Game conflicts with import Game.Game.Game at
> source/Game/Game.d(2) (spacecraft)
>
> I figure it's because I did imports wrong or something. I'm still very
> new to D. Can anyone help?

The problem is with having three constructs with the same name: package, 
module, and class.

I would use lowercase for package, and module names, and differentiate 
between the package and the module:

.../source/foogame/game.d

module foogame.game;

class Game
{
     // ...
}

Ali



More information about the Digitalmars-d-learn mailing list