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

Gan via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jan 25 14:43:54 PST 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



More information about the Digitalmars-d-learn mailing list