D - DMD 0.77 bug: interface broken.
- Burton Radons (61/61) Jan 20 2004 Here's an example where calling a method on an interface breaks using
- John Reimer (1/1) Jan 20 2004 Welcome back, Burton. Nice to hear from you. Hope you're here to stay. ...
- J Anderson (3/3) Jan 20 2004 Welcome Back.
- Walter (3/5) Jan 21 2004 Thanks, I'll check it out. And welcome back! We've missed you here.
- Burton Radons (3/83) Mar 08 2004 These bugs remain in 0.81; I can't do anything with dig - or anything
- Tu Nam (35/118) Mar 08 2004 I fixed a bit about your sample.
- =?ISO-8859-1?Q?Julio_Jim=E9nez?= (9/48) Mar 09 2004 Well your code run fine, but is not the Burton Radons code.....
- Tu Nam (9/57) Mar 09 2004 I'm terrible sorry , perhap I overdosed ;(((
- Kris (7/90) Mar 31 2004 I, too, have run aground on each of these issues; they are still present...
- Walter (6/65) May 25 2004 Fixed in next update.
Here's an example where calling a method on an interface breaks using DMD 0.77. interface I { void M (); } interface J : I { void N (); } class A : I { void M () { } } class B : A, J { void N () { } } void main () { I f = new B (); f.M (); // Access violation. } This code is valid; the function call should work. Also, interface methods are not being treated like methods, as they should be. For example: interface I { void M (); void N (); } class A : I { // Doesn't work; it requires a body. abstract void M (); // Doesn't work; it's not considered part of the inheritance. override void N () { } } These should both work. Finally, this causes an access violation inside of the cast. It should work. interface A { void ma (); } interface B { void mb (); } class C : A, B { void ma () { } void mb () { } } void main () { A x = new C (); assert (cast (B) x); } I should explain what my situation is, but I don't feel like going into it right now.
Jan 20 2004
Welcome back, Burton. Nice to hear from you. Hope you're here to stay. :)
Jan 20 2004
Welcome Back. What are your plans with dig and the other cool software on your website? -Anderson
Jan 20 2004
"Burton Radons" <loth users.sourceforge.net> wrote in message news:buku5a$21sm$1 digitaldaemon.com...Here's an example where calling a method on an interface breaks using DMD 0.77.Thanks, I'll check it out. And welcome back! We've missed you here.
Jan 21 2004
Burton Radons wrote:Here's an example where calling a method on an interface breaks using DMD 0.77. interface I { void M (); } interface J : I { void N (); } class A : I { void M () { } } class B : A, J { void N () { } } void main () { I f = new B (); f.M (); // Access violation. } This code is valid; the function call should work. Also, interface methods are not being treated like methods, as they should be. For example: interface I { void M (); void N (); } class A : I { // Doesn't work; it requires a body. abstract void M (); // Doesn't work; it's not considered part of the inheritance. override void N () { } } These should both work. Finally, this causes an access violation inside of the cast. It should work. interface A { void ma (); } interface B { void mb (); } class C : A, B { void ma () { } void mb () { } } void main () { A x = new C (); assert (cast (B) x); } I should explain what my situation is, but I don't feel like going into it right now.These bugs remain in 0.81; I can't do anything with dig - or anything with interface abstraction - until they're fixed.
Mar 08 2004
I fixed a bit about your sample. import std.c.stdio; interface I { public void M (); } interface J : I { public void N (); } class A : I { public void M () {printf("Hello from A"); } } class B : A, J { public void N () { } } void main () { J f = new B (); f.M (); getch(); } It's work . BTW, I think that if you don't define "public" , initialy D will know it's protected-package methods . I don't know much about OO with interface but when I test your sample in Java , it don't work just like D . But if I treat method of interface is public then it work . In Java if not have accessor so it know method is package protected methods , and , sorry for my OO stupid , I don't know why it didn't work unless "public" . Please could you have advise the case which you use "protected method" in interface ??? "Burton Radons" <loth users.sourceforge.net> wrote in message news:c2i4dg$lfs$1 digitaldaemon.com...Burton Radons wrote:Here's an example where calling a method on an interface breaks using DMD 0.77. interface I { void M (); } interface J : I { void N (); } class A : I { void M () { } } class B : A, J { void N () { } } void main () { I f = new B (); f.M (); // Access violation. } This code is valid; the function call should work. Also, interface methods are not being treated like methods, as they should be. For example: interface I { void M (); void N (); } class A : I { // Doesn't work; it requires a body. abstract void M (); // Doesn't work; it's not considered part of the inheritance. override void N () { } } These should both work. Finally, this causes an access violation inside of the cast. It should work. interface A { void ma (); } interface B { void mb (); } class C : A, B { void ma () { } void mb () { } } void main () { A x = new C (); assert (cast (B) x); } I should explain what my situation is, but I don't feel like going into it right now.These bugs remain in 0.81; I can't do anything with dig - or anything with interface abstraction - until they're fixed.
Mar 08 2004
Tu Nam wrote:I fixed a bit about your sample. import std.c.stdio; interface I { public void M (); } interface J : I { public void N (); } class A : I { public void M () {printf("Hello from A"); } } class B : A, J { public void N () { } } void main () { J f = new B (); f.M (); getch(); } It's work . BTW, I think that if you don't define "public" , initialy D will know it's protected-package methods . I don't know much about OO with interface butWrong, members are public by default (not protected).when I test your sample in Java , it don't work just like D . But if I treat method of interface is public then it work . In Java if not have accessor so it know method is package protected methods , and , sorry for my OO stupid , I don't know why it didn't work unless "public" . Please could you have advise the case which you use "protected method" in interface ???Well your code run fine, but is not the Burton Radons code..... you write: J f = new B (); but you must write following Burton's example: I f = new B (); that cause Access violation when f.M () is executed. Another thing,
Mar 09 2004
I'm terrible sorry , perhap I overdosed ;((( "Julio Jiménez" <jujibo inicia.es> wrote in message news:c2kiiv$1t40$1 digitaldaemon.com...Tu Nam wrote:it'sI fixed a bit about your sample. import std.c.stdio; interface I { public void M (); } interface J : I { public void N (); } class A : I { public void M () {printf("Hello from A"); } } class B : A, J { public void N () { } } void main () { J f = new B (); f.M (); getch(); } It's work . BTW, I think that if you don't define "public" , initialy D will knowbutprotected-package methods . I don't know much about OO with interfaceWrong, members are public by default (not protected).treatwhen I test your sample in Java , it don't work just like D . But if Iaccessor somethod of interface is public then it work . In Java if not havestupid ,it know method is package protected methods , and , sorry for my OOinI don't know why it didn't work unless "public" . Please could you have advise the case which you use "protected method"interface ???Well your code run fine, but is not the Burton Radons code..... you write: J f = new B (); but you must write following Burton's example: I f = new B (); that cause Access violation when f.M () is executed. Another thing,
Mar 09 2004
I, too, have run aground on each of these issues; they are still present in 0.82, and are giving me grief with Dsc. Access violations of any kind should ideally be fixed asap, but these interface-related ones seem to persist longer than one might hope for. Maybe we should petition Walter <g> "Burton Radons" <loth users.sourceforge.net> wrote in message news:c2i4dg$lfs$1 digitaldaemon.com...Burton Radons wrote:Here's an example where calling a method on an interface breaks using DMD 0.77. interface I { void M (); } interface J : I { void N (); } class A : I { void M () { } } class B : A, J { void N () { } } void main () { I f = new B (); f.M (); // Access violation. } This code is valid; the function call should work. Also, interface methods are not being treated like methods, as they should be. For example: interface I { void M (); void N (); } class A : I { // Doesn't work; it requires a body. abstract void M (); // Doesn't work; it's not considered part of the inheritance. override void N () { } } These should both work. Finally, this causes an access violation inside of the cast. It should work. interface A { void ma (); } interface B { void mb (); } class C : A, B { void ma () { } void mb () { } } void main () { A x = new C (); assert (cast (B) x); } I should explain what my situation is, but I don't feel like going into it right now.These bugs remain in 0.81; I can't do anything with dig - or anything with interface abstraction - until they're fixed.
Mar 31 2004
"Burton Radons" <loth users.sourceforge.net> wrote in message news:buku5a$21sm$1 digitaldaemon.com...Here's an example where calling a method on an interface breaks using DMD 0.77. interface I { void M (); } interface J : I { void N (); } class A : I { void M () { } } class B : A, J { void N () { } } void main () { I f = new B (); f.M (); // Access violation. } This code is valid; the function call should work.Fixed in next update.Also, interface methods are not being treated like methods, as they should be. For example: interface I { void M (); void N (); } class A : I { // Doesn't work; it requires a body. abstract void M ();Already fixed.// Doesn't work; it's not considered part of the inheritance. override void N () { }This doesn't compile, and I don't think it should.} These should both work. Finally, this causes an access violation inside of the cast. It should work. interface A { void ma (); } interface B { void mb (); } class C : A, B { void ma () { } void mb () { } } void main () { A x = new C (); assert (cast (B) x); }This currently works.
May 25 2004