To facilitate language implementation on the underlying platform (CLR), for each source member declaration that is a property or event, the implementation must reserve two method signatures based on the kind of the member declaration, its name, and its type. It is a compile error for a program to declare a member, whose signature matches one of these reserved signatures.
The reserved names do not introduce declarations, thus they do not participate in member lookup.
The following signatures are reserved for a simple property P of a type T:
Function get_P: T;
Sub set_P(value: T);
The following signatures are reserved for an indexed property P with the type T and parameter list L:
Function get_P(L): T;
Sub set_P(L; value: T);
The following signatures are reserved for an event E with a delegate type T:
Sub add_E(handler: T);
Sub remove_E(handler: T);
Delegate MyDelegat(i: integer);
Class ReservedId
//Property, for which a function and procedure are reserved
Property Test: integer
Get
Begin
Return 1;
End Get
Set
Begin
End Set
End Property Test;
//Event, for which two procedures are reserved
Event OnMyEvent: MyDelegat;
//Members that cause compile error when they are declared
Function get_Test(): integer;
Begin
End Function;
Sub set_Test(value: integer);
Begin
End Sub;
Sub add_OnMyEvent(handler: MyDelegat);
Begin
End Sub;
Sub remove_OnMyEvent(handler: MyDelegat);
Begin
End Sub;
End Class ReservedId;
See also: