digitalmars.D.bugs - [Issue 414] New: interfaces shouldn't be able to inheit from classes
- d-bugmail puremagic.com (47/47) Oct 09 2006 http://d.puremagic.com/issues/show_bug.cgi?id=414
- d-bugmail puremagic.com (9/9) Oct 18 2006 http://d.puremagic.com/issues/show_bug.cgi?id=414
- Thomas Kuehne (13/16) Oct 21 2006 -----BEGIN PGP SIGNED MESSAGE-----
http://d.puremagic.com/issues/show_bug.cgi?id=414
Summary: interfaces shouldn't be able to inheit from classes
Product: D
Version: 0.169
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla digitalmars.com
ReportedBy: davidl 126.com
http://paste.dprogramming.com/dpi6v8ch.php
interfaces shouldn't be able to inheit from classes
import std.c.stdio;
import std.stdio;
interface a{
int c();
}
void main()
{
class b:a{
int c(){writefln("b.c");return 1;}
}
class c:b{
int c(){writefln("c.c");return 1;}
}
class f:b{
int k(){writefln("f.k");return 1;}
}
interface u:c,f,a{
int c();
int k();
}
class d:u
{
int c(){writefln("d.c");return 2;}
int k(){writefln("d.k");return 2;}
}
d a= new d;
c v= cast(c)a;
f newf=cast(f)a;
a.k(); //prints d.k
newf.k(); //access violation
v.c(); //access violation
}
--
Oct 09 2006
http://d.puremagic.com/issues/show_bug.cgi?id=414
bugzilla digitalmars.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Fixed DMD 0.170
--
Oct 18 2006
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 d-bugmail puremagic.com schrieb am 2006-10-09:http://d.puremagic.com/issues/show_bug.cgi?id=414http://paste.dprogramming.com/dpi6v8ch.php interfaces shouldn't be able to inheit from classes<snip> Added to DStress as http://dstress.kuehne.cn/nocompile/i/interface_25_A.d http://dstress.kuehne.cn/nocompile/i/interface_25_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFOixCLK5blCcjpWoRAqidAJ43AN588E9oakaelzyHC7oedpEs/gCfZ+aC 9ia/LSwK8hO7X2+GMymVKGA= =TleA -----END PGP SIGNATURE-----
Oct 21 2006









d-bugmail puremagic.com 