Jon Jagger
Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specificationpreviousnextprevious at this levelnext at this level 17 Classesprevious at this levelnext at this level 17.10 Instance constructorsprevious at this levelnext at this level 17.10.1 Constructor initializers Paragraph 11 All instance constructors (except those for class object) implicitly include an invocation of another instance constructor immediately before the constructor-body. 2 The constructor to implicitly invoke is determined by the constructor-initializer: Paragraph 21 If an instance constructor has no constructor initializer, a constructor initializer of the form base() is implicitly provided. [Note: Thus, an instance constructor declaration of the form
C(...) {...}  
is exactly equivalent to
C(...): base() {...}  
end note]
Paragraph 31 The scope of the parameters given by the formal-parameter-list of an instance constructor declaration includes the constructor initializer of that declaration. 2 Thus, a constructor initializer is permitted to access the parameters of the constructor. [Example: For example:
class A  
   public A(int x, int y) {}  
class B: A  
   public B(int x, int y): base(x + y, x - y) {}  
end example]
Paragraph 41 An instance constructor initializer cannot access the instance being created. 2 Therefore it is a compile-time error to reference this in an argument expression of the constructor initializer, as it is a compile-time error for an argument expression to reference any instance member through a simple-name.
{ JSL }
Jagger Software Ltd
Company # 4070126
VAT # 762 5213 42
Valid HTML 4.01Valid CSS