Hi there,

Does anyone know why this compiles:

        public interface Ii {}

        public class A : Ii
        {
                public static Ii Ii {
                        get { return B.Instance; }
                }
        }

        public class B : Ii
        {
                private B() {}

                public static Ii Instance {
                        get {
                                Ii b = new B();
                                return b;
                        }
                }
        }

but this (i.e. A.Ii static property is renamed A.B) gives the apparently
misleading error "interface Ii does not contain definition of Instance":

        public interface Ii {}

        public class A : Ii
        {
                public static Ii B {
                        get { return B.Instance; }
                }
        }

        public class B : Ii
        {
                private B() {}

                public static Ii Instance {
                        get {
                                Ii b = new B();
                                return b;
                        }
                }
        }


thanks a lot

Julian

IMPORTANT NOTICE
This communication contains information, which is confidential and may also
be privileged. It is for the exclusive use of the intended recipient(s). If
you are not the intended recipient(s) please note that any form of
distribution, copying or use of this communication or the information in it
is strictly prohibited and may be unlawful. If you have received this
communication in error please return it to the sender. The opinions
expressed within this communication are not necessarily those expressed by
Teletext Ltd.

Teletext Ltd.
Building 10
Chiswick Park
566 Chiswick High Road
London W4 5TS

Registered in England number 2694814

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

Guerrilla ASP.NET, 10 Nov 2003 in London and 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnet

Guerrilla .NET, 8 Dec 2003, in Los Angeles
http://www.develop.com/courses/gdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to