Thread overview
Conflicts with Import error - New to D, trying to build a new project
Jan 25, 2015
Gan
Jan 25, 2015
Ali Çehreli
Jan 25, 2015
Gan
January 25, 2015
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?
January 25, 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

January 25, 2015
Thanks. I didn't realize that could conflict.

On Sunday, 25 January 2015 at 21:22:50 UTC, Ali Çehreli wrote:
> 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