www.digitalmars.com         C & C++   DMDScript  

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

reply "Gan" <avisaria me.com> writes:
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?
Jan 25 2015
parent reply =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
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
Jan 25 2015
parent "Gan" <avisaria me.com> writes:
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
Jan 25 2015