G
Guest
I'm declaring an interface (or two), but getting a compile-time error...
│ public abstract class Args
│ {
│ }
(I've also tried it as an interface, with the same result.)
│
│ public class MyArgs : Args
│ {
│ string Args1 = "Args 1" ;
│ }
│
│
│ public interface IArguable
│ {
│ void Argue ( Args args ) ;
│ }
│
│ public class Argument : IArguable
│ {
│ private string arg1 ;
│
│ public void Argue ( MyArgs args )
│ {
│ this.arg1 = args.Args1 ;
│ }
│ }
Yields:
ct.cs(30,18): error CS0535: 'Template.Argument' does not implement interface
member 'Template.IArguable.Argue(Template.Args)'
I thought it would be OK because MyArgs IS_A Args. I can change it to:
│ public void Argue ( Args args )
│ {
│ this.arg1 = ((MyArgs) args).Args1 ;
│ }
But I don't think I should need to. Is there something I'm missing? Is this
a limitation of interfaces? Is it a bug? (I see the same behaviour in the V2
beta.)
│ public abstract class Args
│ {
│ }
(I've also tried it as an interface, with the same result.)
│
│ public class MyArgs : Args
│ {
│ string Args1 = "Args 1" ;
│ }
│
│
│ public interface IArguable
│ {
│ void Argue ( Args args ) ;
│ }
│
│ public class Argument : IArguable
│ {
│ private string arg1 ;
│
│ public void Argue ( MyArgs args )
│ {
│ this.arg1 = args.Args1 ;
│ }
│ }
Yields:
ct.cs(30,18): error CS0535: 'Template.Argument' does not implement interface
member 'Template.IArguable.Argue(Template.Args)'
I thought it would be OK because MyArgs IS_A Args. I can change it to:
│ public void Argue ( Args args )
│ {
│ this.arg1 = ((MyArgs) args).Args1 ;
│ }
But I don't think I should need to. Is there something I'm missing? Is this
a limitation of interfaces? Is it a bug? (I see the same behaviour in the V2
beta.)