Alexander Suraphel
11/01/2021, 2:12 PMR
supposed to be set by default on this snippet?Casey Brooks
11/01/2021, 2:19 PMthisRef
will refer to the object that contains the delegate, which would be an instance of class D
in your snippet.
Delegates can also be used on local or top-level properties, at which point it doesn't have a "containing object" to refer to and will be the Nothing
typeAlexander Suraphel
11/01/2021, 2:22 PMCasey Brooks
11/01/2021, 2:42 PMR
type will always refer to the type of class it's contained in (or Nothing
). So the compiler sees that you're calling EffectiveDate()
and assigning it to a member property within class D
, so that becomes the R
type