@@ -80,7 +80,7 @@ If the variance annotation is `out`, the type parameter is said to be ***covaria
80
80
81
81
> * Example* : In the following:
82
82
>
83
- > <!-- Example: {template:"standalone-lib", name:"VariantTypeParameterLists"} -->
83
+ > <!-- Example: {template:"standalone-lib-without-using ", name:"VariantTypeParameterLists"} -->
84
84
> ``` csharp
85
85
> interface C <out X , in Y , Z >
86
86
> {
@@ -153,7 +153,7 @@ The ***base interfaces*** of an interface are the explicit base interfaces and t
153
153
154
154
> * Example* : In the following code
155
155
>
156
- > <!-- Example: {template:"standalone-lib", name:"BaseInterfaces1"} -->
156
+ > <!-- Example: {template:"standalone-lib-without-using ", name:"BaseInterfaces1"} -->
157
157
> ``` csharp
158
158
> interface IControl
159
159
> {
@@ -181,7 +181,7 @@ Members inherited from a constructed generic type are inherited after type subst
181
181
182
182
> *Example*: In the following code
183
183
>
184
- > <!-- Example : {template :"standalone -lib ", name :"BaseInterfaces2 "} -->
184
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"BaseInterfaces2 "} -->
185
185
> ```csharp
186
186
> interface IBase <T >
187
187
> {
@@ -194,7 +194,7 @@ Members inherited from a constructed generic type are inherited after type subst
194
194
> }
195
195
> ```
196
196
>
197
- > the interface IDerived inherits the Combine method after the type parameter `T` is replaced with `string[,]`.
197
+ > the interface ` IDerived` inherits the ` Combine` method after the type parameter `T` is replaced with `string[,]`.
198
198
>
199
199
> *end example*
200
200
@@ -273,7 +273,7 @@ These rules ensure that any covariant or contravariant usage of the interface re
273
273
274
274
> * Example* :
275
275
>
276
- > <!-- Example: {template:"standalone-lib", name:"InterfaceMethods1", expectedErrors:["CS1961"]} -->
276
+ > <!-- Example: {template:"standalone-lib-without-using ", name:"InterfaceMethods1", expectedErrors:["CS1961"]} -->
277
277
> ``` csharp
278
278
> interface I <out T >
279
279
> {
@@ -285,7 +285,8 @@ These rules ensure that any covariant or contravariant usage of the interface re
285
285
>
286
286
> Were this restriction not in place it would be possible to violate type safety in the following manner :
287
287
>
288
- > < ! -- IncompleteExample : {template : " standalone-lib" , name : " InterfaceMethods2" , replaceEllipsis : true , expectedErrors : [" x" ," x" ], expectedWarnings : [" x" ," x" ]} -- >
288
+ > < ! -- Incomplete $Example : {template : " standalone-lib-without-using" , name : " InterfaceMethods2" , replaceEllipsis : true , expectedErrors : [" x" ," x" ], expectedWarnings : [" x" ," x" ]} -- >
289
+ > < ! -- FIX : need to define I < T > , then perhaps break into 2 files , first one a standalone - lib , the second , code - in - class-lib. -->
289
290
> ```csharp
290
291
> class B {}
291
292
> class D : B {}
@@ -373,7 +374,7 @@ For interfaces that are strictly single-inheritance (each interface in the inher
373
374
374
375
> * Example* : In the following code
375
376
>
376
- > <!-- NeedsReviewExample : {template:"standalone-lib", name:"InterfaceMemberAccess1", expectedErrors:["x","x"], expectedWarnings:["x","x"]} -->
377
+ > <!-- NeedsReview$Example : {template:"standalone-lib-without-using ", name:"InterfaceMemberAccess1", expectedErrors:["x","x"], expectedWarnings:["x","x"]} -->
377
378
> ``` csharp
378
379
> interface IList
379
380
> {
@@ -407,7 +408,7 @@ For interfaces that are strictly single-inheritance (each interface in the inher
407
408
<!-- markdownlint -enable MD028 -->
408
409
> *Example *: In the following code
409
410
>
410
- > < ! -- Example : {template : " standalone-lib" , name : " InterfaceMemberAccess2" } -- >
411
+ > < ! -- Example : {template : " standalone-lib-without-using " , name : " InterfaceMemberAccess2" } -- >
411
412
> ```csharp
412
413
> interface IInteger
413
414
> {
@@ -441,7 +442,7 @@ For interfaces that are strictly single-inheritance (each interface in the inher
441
442
< ! -- markdownlint - enable MD028 -- >
442
443
> * Example * : In the following code
443
444
>
444
- > < ! -- Example : {template : " standalone-lib" , name : " InterfaceMemberAccess3" } -- >
445
+ > < ! -- Example : {template : " standalone-lib-without-using " , name : " InterfaceMemberAccess3" } -- >
445
446
> ```csharp
446
447
> interface IBase
447
448
> {
@@ -484,7 +485,7 @@ An interface member is sometimes referred to by its ***qualified interface membe
484
485
485
486
> *Example*: Given the declarations
486
487
>
487
- > <!-- Example: {template:"standalone-lib", name:"QualifiedInterfaceMemberNames1"} -- >
488
+ > <!-- Example: {template:"standalone-lib-without-using ", name:"QualifiedInterfaceMemberNames1"} -- >
488
489
> ```csharp
489
490
> interface IControl
490
491
> {
@@ -505,7 +506,7 @@ When an interface is part of a namespace, a qualified interface member name can
505
506
506
507
> *Example*:
507
508
>
508
- > <!-- Example : {template :"standalone -lib ", name :"QualifiedInterfaceMemberNames2 "} -->
509
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"QualifiedInterfaceMemberNames2 "} -->
509
510
> ```csharp
510
511
> namespace System
511
512
> {
@@ -528,7 +529,7 @@ Interfaces may be implemented by classes and structs. To indicate that a class o
528
529
529
530
> *Example*:
530
531
>
531
- > <!-- IncompleteExample : {template :"standalone -lib ", name :"InterfaceImplementations1 ", replaceEllipsis :true , expectedErrors :["x","x"], expectedWarnings :["x","x "]} -->
532
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"InterfaceImplementations1 ", replaceEllipsis :true , customEllipsisReplacements : ["return default;", "return default; "]} -->
532
533
> ```csharp
533
534
> interface ICloneable
534
535
> {
@@ -553,7 +554,7 @@ A class or struct that directly implements an interface also implicitly implemen
553
554
554
555
> *Example*:
555
556
>
556
- > <!-- Example : {template :"standalone -lib ", name :"InterfaceImplementations2 ", replaceEllipsis :true } -->
557
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"InterfaceImplementations2 ", replaceEllipsis :true } -->
557
558
> ```csharp
558
559
> interface IControl
559
560
> {
@@ -582,7 +583,7 @@ The base interfaces specified in a class declaration can be constructed interfac
582
583
583
584
> *Example*: The following code illustrates how a class can implement constructed interface types :
584
585
>
585
- > <!-- Example : {template :"standalone -lib ", name :"InterfaceImplementations3 "} -->
586
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"InterfaceImplementations3 "} -->
586
587
> ```csharp
587
588
> class C <U , V > {}
588
589
> interface I1 <V > {}
@@ -600,7 +601,7 @@ For purposes of implementing interfaces, a class or struct may declare ***explic
600
601
601
602
> *Example*:
602
603
>
603
- > <!-- IncompleteExample : {template :"standalone -lib ", name :"ExplicitInterfaceMemberImplementations1 ", replaceEllipsis :true , expectedErrors :["CS0161","CS0161 "]} -->
604
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"ExplicitInterfaceMemberImplementations1 ", replaceEllipsis :true , customEllipsisReplacements : ["return default;", "get { return default; }", "return; "]} -->
604
605
> ```csharp
605
606
> interface IList <T >
606
607
> {
@@ -629,7 +630,7 @@ For purposes of implementing interfaces, a class or struct may declare ***explic
629
630
<!-- markdownlint -enable MD028 -->
630
631
> *Example*: In some cases , the name of an interface member might not be appropriate for the implementing class , in which case , the interface member may be implemented using explicit interface member implementation . A class implementing a file abstraction , for example , would likely implement a `Close ` member function that has the effect of releasing the file resource , and implement the `Dispose ` method of the `IDisposable ` interface using explicit interface member implementation :
631
632
>
632
- > <!-- Example : {template :"standalone -lib ", name :"ExplicitInterfaceMemberImplementations2 "} -->
633
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"ExplicitInterfaceMemberImplementations2 "} -->
633
634
> ```csharp
634
635
> interface IDisposable
635
636
> {
@@ -668,7 +669,7 @@ For an explicit interface member implementation to be valid, the class or struct
668
669
669
670
> *Example *: Thus , in the following class
670
671
>
671
- > <!-- IncompleteExample : {template :"standalone -lib ", name :"ExplicitInterfaceMemberImplementations3 ", replaceEllipsis :true , expectedErrors :["CS0540"]} -->
672
+ > <!-- Example : {template :"standalone -lib ", name :"ExplicitInterfaceMemberImplementations3 ", replaceEllipsis :true , customEllipsisReplacements : ["return default;", "return default;"] , expectedErrors :["CS0540"]} -->
672
673
> ```csharp
673
674
> class Shape : ICloneable
674
675
> {
@@ -679,7 +680,7 @@ For an explicit interface member implementation to be valid, the class or struct
679
680
>
680
681
> the declaration of `IComparable .CompareTo ` results in a compile - time error because `IComparable ` is not listed in the base class list of `Shape ` and is not a base interface of `ICloneable `. Likewise , in the declarations
681
682
>
682
- > < ! -- IncompleteExample : {template : " standalone-lib" , name : " ExplicitInterfaceMemberImplementations4" , replaceEllipsis : true , expectedErrors : [" CS0540" ]} -- >
683
+ > < ! -- Example : {template : " standalone-lib" , name : " ExplicitInterfaceMemberImplementations4" , replaceEllipsis : true , customEllipsisReplacements : [ " return default; " , " return default; " ] , expectedErrors : [" CS0540" ]} -- >
683
684
> ```csharp
684
685
> class Shape : ICloneable
685
686
> {
@@ -700,7 +701,7 @@ The qualified interface member name of an explicit interface member implementati
700
701
701
702
> *Example *: Thus , in the declarations
702
703
>
703
- > < ! -- Example : {template : " standalone-lib" , name : " ExplicitInterfaceMemberImplementations5" , replaceEllipsis : true } -- >
704
+ > < ! -- Example : {template : " standalone-lib-without-using " , name : " ExplicitInterfaceMemberImplementations5" , replaceEllipsis : true } -- >
704
705
> ```csharp
705
706
> interface IControl
706
707
> {
@@ -729,7 +730,7 @@ The interfaces implemented by a generic type declaration shall remain unique for
729
730
730
731
> *Example*: Suppose a generic class declaration were permitted to be written as follows :
731
732
>
732
- > <!-- Example : {template :"standalone -lib ", name :"UniquenessOfImplementedInterfaces1 ", replaceEllipsis :true , expectedErrors :["CS0695"]} -->
733
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"UniquenessOfImplementedInterfaces1 ", replaceEllipsis :true , expectedErrors :["CS0695"]} -->
733
734
> ```csharp
734
735
> interface I <T >
735
736
> {
@@ -763,7 +764,7 @@ To determine if the interface list of a generic type declaration is valid, the f
763
764
764
765
It is possible for interfaces specified at different inheritance levels to unify :
765
766
766
- <!-- Example : {template :"standalone -lib ", name :"UniquenessOfImplementedInterfaces2 ", replaceEllipsis :true } -->
767
+ <!-- Example : {template :"standalone -lib - without - using ", name :"UniquenessOfImplementedInterfaces2 ", replaceEllipsis :true } -->
767
768
```csharp
768
769
interface I <T >
769
770
{
@@ -796,7 +797,8 @@ When a generic method implicitly implements an interface method, the constraints
796
797
797
798
> * Example* : In the following code:
798
799
>
799
- > <!-- Example: {template:"standalone-lib", name:"ImplementationOfGenericMethods1", replaceEllipsis:true, expectedErrors:["CS0425","CS0701"]} -->
800
+ > <!-- Example: {template:"standalone-lib-without-using", name:"ImplementationOfGenericMethods1", replaceEllipsis:true, expectedErrors:["CS0425","CS0701"]} -->
801
+ > <!-- Maintenance Note: A version of this type exists in additional-files as "ITTT.cs". As such, certain changes to this type definition might need to be reflected in that file, in which case, *all* examples using that file should be tested. -->
800
802
> ``` csharp
801
803
> interface I <X , Y , Z >
802
804
> {
@@ -815,7 +817,7 @@ When a generic method implicitly implements an interface method, the constraints
815
817
>
816
818
> the method `C .F < T > ` implicitly implements `I <object ,C ,string >.F < T > `. In this case , `C .F < T > ` is not required (nor permitted ) to specify the constraint `T : object ` since `object ` is an implicit constraint on all type parameters . The method `C .G <T >` implicitly implements `I <object ,C ,string > .G < T > ` because the constraints match those in the interface, after the interface type parameters are replaced with the corresponding type arguments. The constraint for method `C.H<T >` is an error because sealed types (`string` in this case) cannot be used as constraints. Omitting the constraint would also be an error since constraints of implicit interface method implementations are required to match. Thus, it is impossible to implicitly implement `I<object ,C ,string >.H<T >`. This interface method can only be implemented using an explicit interface member implementation:
817
819
>
818
- > <!-- IncompleteExample : {template :"standalone -lib ", name :"ImplementationOfGenericMethods2 ", replaceEllipsis :true , expectedErrors :["x","x"], expectedWarnings :["x","x "]} -->
820
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"ImplementationOfGenericMethods2 ", replaceEllipsis :true , additionalFiles :["ITTT.cs "]} -->
819
821
> ```csharp
820
822
> class C : I <object , C , string >
821
823
> {
@@ -852,7 +854,7 @@ Members of a constructed interface type are considered to have any type paramete
852
854
853
855
> *Example*: For example , given the generic interface declaration :
854
856
>
855
- > <!-- Example : {template :"standalone -lib ", name :"InterfaceMapping1 "} -->
857
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"InterfaceMapping1 "} -->
856
858
> ```csharp
857
859
> interface I <T >
858
860
> {
@@ -884,7 +886,7 @@ Notable implications of the interface-mapping algorithm are:
884
886
885
887
> *Example *: In the following code
886
888
>
887
- > <!-- IncompleteExample : {template :"standalone -lib ", name :"InterfaceMapping3 ", replaceEllipsis :true , expectedErrors :["x","x"], expectedWarnings :["x","x "]} -->
889
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"InterfaceMapping3 ", replaceEllipsis :true , customEllipsisReplacements : ["return default;", "return default; "]} -->
888
890
> ```csharp
889
891
> interface ICloneable
890
892
> {
@@ -906,7 +908,7 @@ If a class or struct implements two or more interfaces containing a member with
906
908
907
909
> *Example*:
908
910
>
909
- > <!-- Example : {template :"standalone -lib ", name :"InterfaceMapping4 ", replaceEllipsis :true } -->
911
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"InterfaceMapping4 ", replaceEllipsis :true } -->
910
912
> ```csharp
911
913
> interface IControl
912
914
> {
@@ -932,7 +934,7 @@ If a class or struct implements an interface that contains hidden members, then
932
934
933
935
> *Example*:
934
936
>
935
- > <!-- Example : {template :"standalone -lib ", name :"InterfaceMapping5 "} -->
937
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"InterfaceMapping5 "} -->
936
938
> ```csharp
937
939
> interface IBase
938
940
> {
@@ -947,7 +949,8 @@ If a class or struct implements an interface that contains hidden members, then
947
949
>
948
950
> An implementation of this interface would require at least one explicit interface member implementation, and would take one of the following forms
949
951
>
950
- > <!-- IncompleteExample : {template :"standalone -lib ", name :"InterfaceMapping6 ", replaceEllipsis :true , expectedErrors :["x ","x "], expectedWarnings :["x ","x "]} -->
952
+ > <!-- Example : {template :"standalone -lib -without -using ", name :"InterfaceMapping6 ", replaceEllipsis :true , customEllipsisReplacements : ["return default ;", "return default ;", "return default ;"], additionalFiles :["IBase .cs ", "IDerived .cs "]} -->
953
+ > <!-- Maintenance Note : A version of this type exists in additional -files as "IBase .cs " and "IDerived .cs ". As such , certain changes to this type definition might need to be reflected in that file , in which case , *all * examples using that file should be tested . -->
951
954
> ```csharp
952
955
> class C1 : IDerived
953
956
> {
@@ -972,7 +975,7 @@ When a class implements multiple interfaces that have the same base interface, t
972
975
973
976
> *Example*: In the following code
974
977
>
975
- > <!-- Example : {template :"standalone -lib ", name :"InterfaceMapping7 ", replaceEllipsis :true } -->
978
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"InterfaceMapping7 ", replaceEllipsis :true } -->
976
979
> ```csharp
977
980
> interface IControl
978
981
> {
@@ -1005,7 +1008,7 @@ The members of a base class participate in interface mapping.
1005
1008
1006
1009
> *Example*: In the following code
1007
1010
>
1008
- > <!-- Example : {template :"standalone -lib ", name :"InterfaceMapping8 "} -->
1011
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"InterfaceMapping8 "} -->
1009
1012
> ```csharp
1010
1013
> interface Interface1
1011
1014
> {
@@ -1036,7 +1039,8 @@ Without explicitly re-implementing an interface, a derived class cannot in any w
1036
1039
1037
1040
> *Example*: In the declarations
1038
1041
>
1039
- > <!-- Example : {template :"standalone -lib ", name :"InterfaceImplementationInheritance1 ", replaceEllipsis :true } -->
1042
+ > <!-- Example : {template :"standalone -lib -without -using ", name :"InterfaceImplementationInheritance1 ", replaceEllipsis :true } -->
1043
+ > <!-- Maintenance Note : A version of these types exists in additional -files as "IControlControlTextBox1 .cs ". As such , certain changes to these type definitions might need to be reflected in that file , in which case , *all * examples using that file should be tested . -->
1040
1044
> ```csharp
1041
1045
> interface IControl
1042
1046
> {
@@ -1056,7 +1060,7 @@ Without explicitly re-implementing an interface, a derived class cannot in any w
1056
1060
>
1057
1061
> the `Paint ` method in `TextBox ` hides the `Paint ` method in `Control `, but it does not alter the mapping of `Control .Paint ` onto `IControl .Paint `, and calls to `Paint ` through class instances and interface instances will have the following effects
1058
1062
>
1059
- > <!-- IncompleteExample : {template :"standalone -lib ", name :"InterfaceImplementationInheritance2 ", expectedErrors :["x "," x "], expectedWarnings :[" x "," x "]} -->
1063
+ > <!-- Example : {template :"standalone -console - without - using ", name :"InterfaceImplementationInheritance2 ", additionalFiles :["IControlControlTextBox1 . cs "]} -->
1060
1064
> ```csharp
1061
1065
> Control c = new Control();
1062
1066
> TextBox t = new TextBox ();
@@ -1074,7 +1078,8 @@ However, when an interface method is mapped onto a virtual method in a class, it
1074
1078
1075
1079
> *Example*: Rewriting the declarations above to
1076
1080
>
1077
- > <!-- Example : {template :"standalone -lib ", name :"InterfaceImplementationInheritance3 ", replaceEllipsis :true } -->
1081
+ > <!-- Example : {template :"standalone -lib -without -using ", name :"InterfaceImplementationInheritance3 ", replaceEllipsis :true } -->
1082
+ > <!-- Maintenance Note : A version of these types exists in additional -files as "IControlControlTextBox2 .cs ". As such , certain changes to these type definitions might need to be reflected in that file , in which case , *all * examples using that file should be tested . -->
1078
1083
> ```csharp
1079
1084
> interface IControl
1080
1085
> {
@@ -1094,7 +1099,7 @@ However, when an interface method is mapped onto a virtual method in a class, it
1094
1099
>
1095
1100
> the following effects will now be observed
1096
1101
>
1097
- > < ! -- IncompleteExample : {template : " standalone-lib " , name : " InterfaceImplementationInheritance4" , expectedErrors : [" x " , " x " ], expectedWarnings : [ " x " , " x " ]} -- >
1102
+ > < ! -- Example : {template : " standalone-console-without-using " , name : " InterfaceImplementationInheritance4" , additionalFiles : [" IControlControlTextBox2.cs " ]} -- >
1098
1103
> ```csharp
1099
1104
> Control c = new Control ();
1100
1105
> TextBox t = new TextBox ();
@@ -1112,7 +1117,7 @@ Since explicit interface member implementations cannot be declared virtual, it i
1112
1117
1113
1118
> *Example*:
1114
1119
>
1115
- > <!-- Example : {template :"standalone -lib ", name :"InterfaceImplementationInheritance5 ", replaceEllipsis :true } -->
1120
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"InterfaceImplementationInheritance5 ", replaceEllipsis :true } -->
1116
1121
> ```csharp
1117
1122
> interface IControl
1118
1123
> {
@@ -1143,7 +1148,7 @@ A re-implementation of an interface follows exactly the same interface mapping r
1143
1148
1144
1149
> *Example*: In the declarations
1145
1150
>
1146
- > <!-- Example : {template :"standalone -lib ", name :"InterfaceRe -implementation1 ", replaceEllipsis :true } -->
1151
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"InterfaceRe -implementation1 ", replaceEllipsis :true } -->
1147
1152
> ```csharp
1148
1153
> interface IControl
1149
1154
> {
@@ -1169,7 +1174,7 @@ Inherited public member declarations and inherited explicit interface member dec
1169
1174
1170
1175
> *Example*:
1171
1176
>
1172
- > <!-- Example : {template :"standalone -lib ", name :"InterfaceRe -implementation2 "} -->
1177
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"InterfaceRe -implementation2 "} -->
1173
1178
> ```csharp
1174
1179
> interface IMethods
1175
1180
> {
@@ -1202,7 +1207,7 @@ When a class implements an interface, it implicitly also implements all that int
1202
1207
1203
1208
> *Example*:
1204
1209
>
1205
- > <!-- Example : {template :"standalone -lib ", name :"InterfaceRe -implementation3 ", replaceEllipsis :true } -->
1210
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"InterfaceRe -implementation3 ", replaceEllipsis :true } -->
1206
1211
> ```csharp
1207
1212
> interface IBase
1208
1213
> {
@@ -1237,7 +1242,7 @@ Like a non-abstract class, an abstract class shall provide implementations of al
1237
1242
1238
1243
> *Example*:
1239
1244
>
1240
- > <!-- Example : {template :"standalone -lib ", name :"AbstractClassesAndInterfaces1 "} -->
1245
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"AbstractClassesAndInterfaces1 "} -->
1241
1246
> ```csharp
1242
1247
> interface IMethods
1243
1248
> {
@@ -1260,7 +1265,7 @@ Explicit interface member implementations cannot be abstract, but explicit inter
1260
1265
1261
1266
> *Example*:
1262
1267
>
1263
- > <!-- Example : {template :"standalone -lib ", name :"AbstractClassesAndInterfaces2 "} -->
1268
+ > <!-- Example : {template :"standalone -lib - without - using ", name :"AbstractClassesAndInterfaces2 "} -->
1264
1269
> ```csharp
1265
1270
> interface IMethods
1266
1271
> {
0 commit comments