Show/Hide Toolbars

XSharp

Ambiguity between 'member1' and 'member2'

 

Members of different interfaces have the same name. If you want to keep the same names, you must qualify the names. For more information, see Interfaces.

Note

In some cases, this ambiguity can be resolved by providing an explicit prefix to the identifier via a using alias.

Example

 

The following example generates XS0229:

 

// XS0229.prg  
 
FUNCTION Start AS VOID
   RETURN
FUNCTION Test(x AS IListCounter)  AS VOID
   x:Count := 1
   // Try one of the following lines instead:
   // ((IList)x):Count := 1
   // or
   // ((Icounter)x):Count := 1
   RETURN
 
INTERFACE IList
   PROPERTY Count AS LONG GET SET
   METHOD Counter AS VOID
END INTERFACE
 
INTERFACE ICounter
   PROPERTY Count AS REAL8 GET SET
END INTERFACE
 
INTERFACE IListCounter INHERIT Ilist, ICounter
END INTERFACE