Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

dmd 1.038 and "does not override any function" error

Moderators: larsivi kris

Posted: 12/16/08 23:50:45

Hello,

I've just installing the new dmd 1.038. Now, when I compile Tango, I've got errors:(

Creating imports for DD-tango-core

Creating imports for DD-tango-io

Creating imports for DD-tango-math

Creating imports for DD-tango-net

Creating imports for DD-tango-stdc

Creating imports for DD-tango-sys

Creating imports for DD-tango-text

Creating imports for DD-tango-text-locale

Creating imports for DD-tango-util

Creating imports for DD-tango-time

tango\core => DD-tango-core
Digital Mars Librarian Version 8.02n
Copyright (C) Digital Mars 2000-2007 All Rights Reserved
http://www.digitalmars.com/ctg/lib.html
Digital Mars Librarian complete.
Digital Mars Librarian Version 8.02n
Copyright (C) Digital Mars 2000-2007 All Rights Reserved
http://www.digitalmars.com/ctg/lib.html
Digital Mars Librarian complete.

tango\io => DD-tango-io
tango\io\FilePath.d(288): function tango.io.FilePath.FilePath.opEquals does not override any function
tango\io\FilePath.d(288): function tango.io.FilePath.FilePath.opEquals does not override any function
tango\io\FilePath.d(288): function tango.io.FilePath.FilePath.opEquals does not override any function
tango\io\FilePath.d(288): function tango.io.FilePath.FilePath.opEquals does not override any function
tango\io\FilePath.d(288): function tango.io.FilePath.FilePath.opEquals does not override any function
tango\io\FilePath.d(288): function tango.io.FilePath.FilePath.opEquals does not override any function
tango\io\FilePath.d(288): function tango.io.FilePath.FilePath.opEquals does not override any function
tango\io\stream\DataStream.d(144): function tango.io.stream.DataStream.DataInput.array does not override any function
tango\io\FilePath.d(288): function tango.io.FilePath.FilePath.opEquals does not override any function
tango\io\stream\DataStream.d(144): function tango.io.stream.DataStream.DataInput.array does not override any function

Does someone have an idea on how to fix this ?

Thanks in advance, TSalm

Author Message

Posted: 12/17/08 00:51:23

Yes, you can delete the override keyword. In the FilePath? case, I now that's it's used erroneously. Haven't checked the other case. But 1.038 seems to be seriously broken, so I'm using 1.037 instead myself.

Posted: 12/17/08 08:33:04

DMD 1.038 had a diagnostic bug with 'final override' fixed so it discovers some old errors in Tango. This will be fixed in trunk as soon as possible.

torhu: which issues does 1.038 have?

Posted: 12/17/08 20:44:31 -- Modified: 12/17/08 20:45:18 by
torhu

It's possible that 1.038 works ok with just Tango. But when building my tango+dwt app, it just hangs. Could be the problem discussed in the newsgroup, where people see ridiculously long build times in some cases. I didn't wait to see if it will actually complete building my app sooner or later.

Posted: 12/18/08 00:04:35

fwiw, I'm using dmd-038 to compile Tango, and don't see any noticeable difference in throughput. Still takes less than 1 seconds to compile everything

Posted: 12/18/08 16:40:20

I filed that bug, and I think it was fixed correctly, but reveals another bug.

The compiler is complaining about final override if it is implementing an interface function.

However if you implement an interface function with just override (no final), it works ok. I'm going to file that bug today. I'm not sure if you should be allowed to specify override for an interface (I know it's not allowed in C#), the spec isn't clear.

BTW, I noticed last night that ZipFolder? has the same issue (needs to be fixed).

Posted: 12/18/08 18:08:14

ZipFolder? fixed

Posted: 12/18/08 20:56:45

In Java @Override for interface methods are allowed in 1.6 but not 1.5, so it seems that it may move in that direction. It doesn't really make very much sense for abstract methods and interface methods though, since they already are checked by the compiler.

Posted: 12/18/08 21:19:14

Filed bugzilla issue 2524.

Re: whether override should mean "overrides base function or implements interface," I think this makes code more maintainable.

For example, C# requires override in order to override a virtual function, but override cannot be specified when implementing an interface. On occasion, I've had to switch a base abstract class to an interface, or add an intermediate class between a class and it's interface, and then I have to go through modifying where I have override or not. It's a pain.

Posted: 12/18/08 21:29:03

Yes, so it shouldn't error if you do it.

Posted: 12/19/08 12:41:53

Same problem (final override from interface) in io.device.Device:

/usr/local/include/d-tango/tango/io/device/Device.d(189): function tango.io.device.Device.Device.fileHandle does not override any function