Add a more functional (i.e. fewer-stubs) implementation of System.Data.Linq.
[mono.git] / mcs / docs / ecma334 / 14.5.4.1.xml
1 <?xml version="1.0"?>
2 <clause number="14.5.4.1" title="Identical simple names and type names">
3   <paragraph>In a member access of the form E.I, if E is a single identifier, and if the meaning of E as a <non_terminal where="14.5.2">simple-name</non_terminal> (<hyperlink>14.5.2</hyperlink>) is a constant, field, property, local variable, or parameter with the same type as the meaning of E as a <non_terminal where="10.8">type-name</non_terminal> (<hyperlink>10.8</hyperlink>), then both possible meanings of E are permitted. The two possible meanings of E.I are never ambiguous, since I must necessarily be a member of the type E in both cases. In other words, the rule simply permits access to the static members of E where a compile-time error would otherwise have occurred. </paragraph>
4   <paragraph>
5     <example>[Example: For example: <code_example><![CDATA[
6 struct Color  
7 {  
8    public static readonly Color White = new Color(...);  
9    public static readonly Color Black = new Color(...);  
10    public Color Complement() {...}  
11 }  
12 class A  
13 {  
14    public Color Color;          // Field Color of type Color  
15    void F() {  
16       Color = Color.Black;       // References Color.Black static member  
17       
18       Color = Color.Complement();  // Invokes Complement() on Color field  
19       
20    }  
21    static void G() {  
22       Color c = Color.White;    // References Color.White static member  
23       
24    }  
25 }  
26 ]]></code_example></example>
27   </paragraph>
28   <paragraph>
29     <example>Within the A class, those occurrences of the Color identifier that reference the Color type are underlined, and those that reference the Color field are not underlined. end example]</example>
30   </paragraph>
31 </clause>