www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Scalars attributes with similarly named local functions can cause no compile errors.

reply David L. Davis <SpottedTiger yahoo.com> writes:
oops! Sorry about the mix up on the last post :( Anyway, I'm already aware that
I'm a bug on the planet Earth, yet I'm not subject to any fixing here...but I
must say that my wife has been doing a pretty good job on debugging me so far.
(Still, I don't think there's anyway a total fix can be applied to me this far
into the current life cycle.) :)) Don't mind me...life and application software
just seem very similar at this point. 










































Output:
--------
C:\dmd>dmd minmax.d
minmax.d(32): found '(' when expecting ','
minmax.d(32): found ')' when expecting ';' following 'statement'
minmax.d(33): found '(' when expecting ','
minmax.d(33): found ')' when expecting ';' following 'statement'
minmax.d(34): found '(' when expecting ','
minmax.d(34): found ')' when expecting ';' following 'statement'

C:\dmd>

David L.

-------------------------------------------------------------------
"Dare to reach for the Stars...Dare to Dream, Build, and Achieve!"
-------------------------------------------------------------------

MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
Jun 25 2005
parent reply Chris Sauls <ibisbasenji gmail.com> writes:
David L. Davis wrote:

Why do you even need this? Or is it just something to show the bug with? :)

Here's your error right here... It should be: Or: Only thing is, since '.' is supposed to double as the module-scope operator, the first version /should/ work. But I think its trying to call it as a property-function (or whatever we ended up calling these things) rather than a module-function. Oddness. -- Chris Sauls
Jun 25 2005
parent David L. Davis <SpottedTiger yahoo.com> writes:
In article <d9kcvq$30v8$1 digitaldaemon.com>, Chris Sauls says...
David L. Davis wrote:

Why do you even need this? Or is it just something to show the bug with? :)
Only to show that there's a bug...otherwise the code is pretty useless. :)

Here's your error right here... It should be: Or: Only thing is, since '.' is supposed to double as the module-scope operator, the first version /should/ work. But I think its trying to call it as a property-function (or whatever we ended up calling these things) rather than a module-function. Oddness. -- Chris Sauls
Like you pointed out, the module-scope '.' should work even in this code, and this is exactly the error I wanted to point out. I found this error while writing some code where a wrote my own min() function and added a '.' because I had imported std.math, thinking std.math would have it defined as well. But to my surprise std.math doesn't, and the error occured when I tried to compile the code...so I decided that I should take the time to post a simple clear example of the problem. Overwise it may not be found and fixed anytime soon. <g> David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
Jun 25 2005