[Issue 4647] New: Cannot explicitly call final interface method, ambiguous calls allowed
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Aug 15 10:32:42 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4647
Summary: Cannot explicitly call final interface method,
ambiguous calls allowed
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: andrej.mitrovich at gmail.com
--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2010-08-15 10:32:38 PDT ---
Code on 2.048:
import std.stdio;
interface Timer
{
final void run() { writeln("Timer.run()"); };
}
interface Application
{
final void run() { writeln("Application.run()"); };
}
class TimedApp : Timer, Application
{
}
import std.stdio;
void main()
{
auto app = new TimedApp;
app.Timer.run(); // error, no Timer property
app.Application.run(); // error, no Application property
app.run(); // This would call Timer.run() if the two calls
// above were commented out
}
The comments state what happens.
Note that if I changed the order of the TimedApp signature like so:
class TimedApp : Application, Timer
then the Application's run() method would be called instead of Timer's in the
app.run() call.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list