1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4 
5 using Xunit;
6 
7 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableadd_dcml001.nullandnonnullableadd_dcml001
8 {
9     // <Title>Need to warn on build-in addition operator if one op is null and the other is non-nullable.</Title>
10     // <Description>
11     // We should warn whenever one of the builtin nullable operators is used and one op is null and
12     // the other is not a nullable
13     // </Description>
14     // <RelatedBugs></RelatedBugs>
15     //
16     // <Expects Status=success></Expects>
17     //
18     // <Code>
19 
20     namespace Test
21     {
22         public class Program
23         {
24             [Fact]
DynamicCSharpRunTest()25             public static void DynamicCSharpRunTest()
26             {
27                 Assert.Equal(0, MainMethod());
28             }
29 
MainMethod()30             public static int MainMethod()
31             {
32                 int rez = 0;
33                 dynamic a = 5M;
34                 var test0 = a + null;
35                 if (test0 == null)
36                     rez++;
37                 var test1 = null + a;
38                 if (test1 == null)
39                     rez++;
40                 return rez == 2 ? 0 : 1;
41             }
42         }
43     }
44     // </Code>
45 }
46 
47 
48 
49 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableadd_dbl001.nullandnonnullableadd_dbl001
50 {
51     // <Title>Need to warn on build-in addition operator if one op is null and the other is non-nullable.</Title>
52     // <Description>
53     // We should warn whenever one of the builtin nullable operators is used and one op is null and
54     // the other is not a nullable
55     // </Description>
56     // <RelatedBugs></RelatedBugs>
57     //
58     // <Expects Status=success></Expects>
59     //
60     // <Code>
61 
62     namespace Test
63     {
64         public class Program
65         {
66             [Fact]
DynamicCSharpRunTest()67             public static void DynamicCSharpRunTest()
68             {
69                 Assert.Equal(0, MainMethod());
70             }
71 
MainMethod()72             public static int MainMethod()
73             {
74                 int rez = 0;
75                 dynamic a = 5.0D;
76                 var test0 = a + null;
77                 if (test0 == null)
78                     rez++;
79                 var test1 = null + a;
80                 if (test1 == null)
81                     rez++;
82                 return rez == 2 ? 0 : 1;
83             }
84         }
85     }
86     // </Code>
87 }
88 
89 
90 
91 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableadd_enum001.nullandnonnullableadd_enum001
92 {
93     // <Title>Need to warn on build-in addition operator if one op is null and the other is non-nullable.</Title>
94     // <Description>
95     // We should warn whenever one of the builtin nullable operators is used and one op is null and
96     // the other is not a nullable
97     // </Description>
98     // <RelatedBugs></RelatedBugs>
99     //
100     // <Expects Status=success></Expects>
101     //
102     // <Code>
103 
104     namespace Test
105     {
106         public class Program
107         {
108             [Fact]
DynamicCSharpRunTest()109             public static void DynamicCSharpRunTest()
110             {
111                 Assert.Equal(0, MainMethod());
112             }
113 
MainMethod()114             public static int MainMethod()
115             {
116                 int rez = 0;
117                 dynamic a = Colors.red;
118                 var test0 = a + null;
119                 if (test0 == null)
120                     rez++;
121                 var test1 = null + a;
122                 if (test1 == null)
123                     rez++;
124                 return rez == 2 ? 0 : 1;
125             }
126 
127             public enum Colors
128             {
129                 red,
130                 green,
131                 blue
132             }
133         }
134     }
135     // </Code>
136 }
137 
138 
139 
140 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableadd_flt001.nullandnonnullableadd_flt001
141 {
142     // <Title>Need to warn on build-in addition operator if one op is null and the other is non-nullable.</Title>
143     // <Description>
144     // We should warn whenever one of the builtin nullable operators is used and one op is null and
145     // the other is not a nullable
146     // </Description>
147     // <RelatedBugs></RelatedBugs>
148     //
149     // <Expects Status=success></Expects>
150     //
151     // <Code>
152 
153     namespace Test
154     {
155         public class Program
156         {
157             [Fact]
DynamicCSharpRunTest()158             public static void DynamicCSharpRunTest()
159             {
160                 Assert.Equal(0, MainMethod());
161             }
162 
MainMethod()163             public static int MainMethod()
164             {
165                 int rez = 0;
166                 dynamic a = 5.0F;
167                 var test0 = a + null;
168                 if (test0 == null)
169                     rez++;
170                 var test1 = null + a;
171                 if (test1 == null)
172                     rez++;
173                 return rez == 2 ? 0 : 1;
174             }
175         }
176     }
177     // </Code>
178 }
179 
180 
181 
182 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableadd_integereger001.nullandnonnullableadd_integereger001
183 {
184     // <Title>Need to warn on build-in addition operator if one op is null and the other is non-nullable.</Title>
185     // <Description>
186     // We should warn whenever one of the builtin nullable operators is used and one op is null and
187     // the other is not a nullable
188     // </Description>
189     // <RelatedBugs></RelatedBugs>
190     //
191     // <Expects Status=success></Expects>
192     //
193     // <Code>
194 
195     namespace Test
196     {
197         public class Program
198         {
199             [Fact]
DynamicCSharpRunTest()200             public static void DynamicCSharpRunTest()
201             {
202                 Assert.Equal(0, MainMethod());
203             }
204 
MainMethod()205             public static int MainMethod()
206             {
207                 int rez = 0;
208                 dynamic a = 5;
209                 var test0 = a + null;
210                 if (test0 == null)
211                     rez++;
212                 var test1 = null + a;
213                 if (test1 == null)
214                     rez++;
215                 return rez == 2 ? 0 : 1;
216             }
217         }
218     }
219     // </Code>
220 }
221 
222 
223 
224 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableadd_lng001.nullandnonnullableadd_lng001
225 {
226     // <Title>Need to warn on build-in addition operator if one op is null and the other is non-nullable.</Title>
227     // <Description>
228     // We should warn whenever one of the builtin nullable operators is used and one op is null and
229     // the other is not a nullable
230     // </Description>
231     // <RelatedBugs></RelatedBugs>
232     //
233     // <Expects Status=success></Expects>
234     //
235     // <Code>
236 
237     namespace Test
238     {
239         public class Program
240         {
241             [Fact]
DynamicCSharpRunTest()242             public static void DynamicCSharpRunTest()
243             {
244                 Assert.Equal(0, MainMethod());
245             }
246 
MainMethod()247             public static int MainMethod()
248             {
249                 int rez = 0;
250                 dynamic a = 5L;
251                 var test0 = a + null;
252                 if (test0 == null)
253                     rez++;
254                 var test1 = null + a;
255                 if (test1 == null)
256                     rez++;
257                 return rez == 2 ? 0 : 1;
258             }
259         }
260     }
261     // </Code>
262 }
263 
264 
265 
266 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableadd_uintegereger001.nullandnonnullableadd_uintegereger001
267 {
268     // <Title>Need to warn on build-in addition operator if one op is null and the other is non-nullable.</Title>
269     // <Description>
270     // We should warn whenever one of the builtin nullable operators is used and one op is null and
271     // the other is not a nullable
272     // </Description>
273     // <RelatedBugs></RelatedBugs>
274     //
275     // <Expects Status=success></Expects>
276     //
277     // <Code>
278 
279     namespace Test
280     {
281         public class Program
282         {
283             [Fact]
DynamicCSharpRunTest()284             public static void DynamicCSharpRunTest()
285             {
286                 Assert.Equal(0, MainMethod());
287             }
288 
MainMethod()289             public static int MainMethod()
290             {
291                 int rez = 0;
292                 dynamic a = 5U;
293                 var test0 = a + null;
294                 if (test0 == null)
295                     rez++;
296                 var test1 = null + a;
297                 if (test1 == null)
298                     rez++;
299                 return rez == 2 ? 0 : 1;
300             }
301         }
302     }
303     // </Code>
304 }
305 
306 
307 
308 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableadd_ulng001.nullandnonnullableadd_ulng001
309 {
310     // <Title>Need to warn on build-in addition operator if one op is null and the other is non-nullable.</Title>
311     // <Description>
312     // We should warn whenever one of the builtin nullable operators is used and one op is null and
313     // the other is not a nullable
314     // </Description>
315     // <RelatedBugs></RelatedBugs>
316     //
317     // <Expects Status=success></Expects>
318     //
319     // <Code>
320 
321     namespace Test
322     {
323         public class Program
324         {
325             [Fact]
DynamicCSharpRunTest()326             public static void DynamicCSharpRunTest()
327             {
328                 Assert.Equal(0, MainMethod());
329             }
330 
MainMethod()331             public static int MainMethod()
332             {
333                 int rez = 0;
334                 dynamic a = 5UL;
335                 var test0 = a + null;
336                 if (test0 == null)
337                     rez++;
338                 var test1 = null + a;
339                 if (test1 == null)
340                     rez++;
341                 return rez == 2 ? 0 : 1;
342             }
343         }
344     }
345     // </Code>
346 }
347 
348 
349 
350 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableand_bol001.nullandnonnullableand_bol001
351 {
352     // <Title>DO NOT warn on build-in bitwise logical AND operator if one op is null and the other is non-nullable.</Title>
353     // <Description>
354     // We should warn whenever one of the builtin nullable operators is used and one op is null and
355     // the other is not a nullable
356     // </Description>
357     // <RelatedBugs></RelatedBugs>
358     // <RelatedBugs></RelatedBugs>
359     //
360     // <Expects Status=success></Expects>
361     // <Code>
362     //<Expects Status=warning>\(28,26\).*CS0458</Expects>
363     //<Expects Status=warning>\(29,30\).*CS0458</Expects>
364 
365     namespace Test
366     {
367         public class Program
368         {
369             [Fact]
DynamicCSharpRunTest()370             public static void DynamicCSharpRunTest()
371             {
372                 Assert.Equal(0, MainMethod());
373             }
374 
MainMethod()375             public static int MainMethod()
376             {
377                 int rez = 0;
378                 dynamic a = true;
379                 if ((a & null) == null)
380                     if ((null & a) == null)
381                         if ((true & null) == null)
382                             if ((null & true) == null)
383                                 return 0;
384                 return rez == 0 ? 0 : 1;
385             }
386         }
387     }
388     // </Code>
389 }
390 
391 
392 
393 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableand_enum001.nullandnonnullableand_enum001
394 {
395     // <Title>Need to warn on build-in bitwise logical AND operator if one op is null and the other is non-nullable.</Title>
396     // <Description>
397     // We should warn whenever one of the builtin nullable operators is used and one op is null and
398     // the other is not a nullable
399     // </Description>
400     // <RelatedBugs></RelatedBugs>
401     //
402     // <Expects Status=success></Expects>
403     //
404     // <Code>
405 
406     namespace Test
407     {
408         public class Program
409         {
410             [Fact]
DynamicCSharpRunTest()411             public static void DynamicCSharpRunTest()
412             {
413                 Assert.Equal(0, MainMethod());
414             }
415 
MainMethod()416             public static int MainMethod()
417             {
418                 int rez = 0;
419                 dynamic a = Colors.red;
420                 var test0 = a & null;
421                 if (test0 == null)
422                     rez++;
423                 var test1 = null & a;
424                 if (test1 == null)
425                     rez++;
426                 return rez == 2 ? 0 : 1;
427             }
428 
429             public enum Colors
430             {
431                 red,
432                 green,
433                 blue
434             }
435         }
436     }
437     // </Code>
438 }
439 
440 
441 
442 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableand_integereger001.nullandnonnullableand_integereger001
443 {
444     // <Title>Need to warn on build-in bitwise logical AND operator if one op is null and the other is non-nullable.</Title>
445     // <Description>
446     // We should warn whenever one of the builtin nullable operators is used and one op is null and
447     // the other is not a nullable
448     // </Description>
449     // <RelatedBugs></RelatedBugs>
450     //
451     // <Expects Status=success></Expects>
452     //
453     // <Code>
454 
455     namespace Test
456     {
457         public class Program
458         {
459             [Fact]
DynamicCSharpRunTest()460             public static void DynamicCSharpRunTest()
461             {
462                 Assert.Equal(0, MainMethod());
463             }
464 
MainMethod()465             public static int MainMethod()
466             {
467                 int rez = 0;
468                 dynamic a = 5;
469                 var test0 = a & null;
470                 if (test0 == null)
471                     rez++;
472                 var test1 = null & a;
473                 if (test1 == null)
474                     rez++;
475                 return rez == 2 ? 0 : 1;
476             }
477         }
478     }
479     // </Code>
480 }
481 
482 
483 
484 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableand_lng001.nullandnonnullableand_lng001
485 {
486     // <Title>Need to warn on build-in bitwise logical AND operator if one op is null and the other is non-nullable.</Title>
487     // <Description>
488     // We should warn whenever one of the builtin nullable operators is used and one op is null and
489     // the other is not a nullable
490     // </Description>
491     // <RelatedBugs></RelatedBugs>
492     //
493     // <Expects Status=success></Expects>
494     //
495     // <Code>
496 
497     namespace Test
498     {
499         public class Program
500         {
501             [Fact]
DynamicCSharpRunTest()502             public static void DynamicCSharpRunTest()
503             {
504                 Assert.Equal(0, MainMethod());
505             }
506 
MainMethod()507             public static int MainMethod()
508             {
509                 int rez = 0;
510                 dynamic a = 5L;
511                 var test0 = a & null;
512                 if (test0 == null)
513                     rez++;
514                 var test1 = null & a;
515                 if (test1 == null)
516                     rez++;
517                 return rez == 2 ? 0 : 1;
518             }
519         }
520     }
521     // </Code>
522 }
523 
524 
525 
526 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableand_uintegereger001.nullandnonnullableand_uintegereger001
527 {
528     // <Title>Need to warn on build-in bitwise logical AND operator if one op is null and the other is non-nullable.</Title>
529     // <Description>
530     // We should warn whenever one of the builtin nullable operators is used and one op is null and
531     // the other is not a nullable
532     // </Description>
533     // <RelatedBugs></RelatedBugs>
534     //
535     // <Expects Status=success></Expects>
536     //
537     // <Code>
538 
539     namespace Test
540     {
541         public class Program
542         {
543             [Fact]
DynamicCSharpRunTest()544             public static void DynamicCSharpRunTest()
545             {
546                 Assert.Equal(0, MainMethod());
547             }
548 
MainMethod()549             public static int MainMethod()
550             {
551                 int rez = 0;
552                 dynamic a = 5U;
553                 var test0 = a & null;
554                 if (test0 == null)
555                     rez++;
556                 var test1 = null & a;
557                 if (test1 == null)
558                     rez++;
559                 return rez == 2 ? 0 : 1;
560             }
561         }
562     }
563     // </Code>
564 }
565 
566 
567 
568 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableand_ulng001.nullandnonnullableand_ulng001
569 {
570     // <Title>Need to warn on build-in bitwise logical AND operator if one op is null and the other is non-nullable.</Title>
571     // <Description>
572     // We should warn whenever one of the builtin nullable operators is used and one op is null and
573     // the other is not a nullable
574     // </Description>
575     // <RelatedBugs></RelatedBugs>
576     //
577     // <Expects Status=success></Expects>
578     //
579     // <Code>
580 
581     namespace Test
582     {
583         public class Program
584         {
585             [Fact]
DynamicCSharpRunTest()586             public static void DynamicCSharpRunTest()
587             {
588                 Assert.Equal(0, MainMethod());
589             }
590 
MainMethod()591             public static int MainMethod()
592             {
593                 int rez = 0;
594                 dynamic a = 5UL;
595                 var test0 = a & null;
596                 if (test0 == null)
597                     rez++;
598                 var test1 = null & a;
599                 if (test1 == null)
600                     rez++;
601                 return rez == 2 ? 0 : 1;
602             }
603         }
604     }
605     // </Code>
606 }
607 
608 
609 
610 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablediv_dcml001.nullandnonnullablediv_dcml001
611 {
612     // <Title>Need to warn on build-in division operator if one op is null and the other is non-nullable.</Title>
613     // <Description>
614     // We should warn whenever one of the builtin nullable operators is used and one op is null and
615     // the other is not a nullable
616     // </Description>
617     // <RelatedBugs></RelatedBugs>
618     //
619     // <Expects Status=success></Expects>
620     //
621     // <Code>
622 
623     namespace Test
624     {
625         public class Program
626         {
627             [Fact]
DynamicCSharpRunTest()628             public static void DynamicCSharpRunTest()
629             {
630                 Assert.Equal(0, MainMethod());
631             }
632 
MainMethod()633             public static int MainMethod()
634             {
635                 int rez = 0;
636                 dynamic a = 5M;
637                 var test0 = a / null;
638                 if (test0 == null)
639                     rez++;
640                 var test1 = null / a;
641                 if (test1 == null)
642                     rez++;
643                 return rez == 2 ? 0 : 1;
644             }
645         }
646     }
647     // </Code>
648 }
649 
650 
651 
652 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablediv_dbl001.nullandnonnullablediv_dbl001
653 {
654     // <Title>Need to warn on build-in division operator if one op is null and the other is non-nullable.</Title>
655     // <Description>
656     // We should warn whenever one of the builtin nullable operators is used and one op is null and
657     // the other is not a nullable
658     // </Description>
659     // <RelatedBugs></RelatedBugs>
660     //
661     // <Expects Status=success></Expects>
662     //
663     // <Code>
664 
665     namespace Test
666     {
667         public class Program
668         {
669             [Fact]
DynamicCSharpRunTest()670             public static void DynamicCSharpRunTest()
671             {
672                 Assert.Equal(0, MainMethod());
673             }
674 
MainMethod()675             public static int MainMethod()
676             {
677                 int rez = 0;
678                 dynamic a = 5.0D;
679                 var test0 = a / null;
680                 if (test0 == null)
681                     rez++;
682                 var test1 = null / a;
683                 if (test1 == null)
684                     rez++;
685                 return rez == 2 ? 0 : 1;
686             }
687         }
688     }
689     // </Code>
690 }
691 
692 
693 
694 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablediv_flt001.nullandnonnullablediv_flt001
695 {
696     // <Title>Need to warn on build-in division operator if one op is null and the other is non-nullable.</Title>
697     // <Description>
698     // We should warn whenever one of the builtin nullable operators is used and one op is null and
699     // the other is not a nullable
700     // </Description>
701     // <RelatedBugs></RelatedBugs>
702     //
703     // <Expects Status=success></Expects>
704     //
705     // <Code>
706 
707     namespace Test
708     {
709         public class Program
710         {
711             [Fact]
DynamicCSharpRunTest()712             public static void DynamicCSharpRunTest()
713             {
714                 Assert.Equal(0, MainMethod());
715             }
716 
MainMethod()717             public static int MainMethod()
718             {
719                 int rez = 0;
720                 dynamic a = 5.0F;
721                 var test0 = a / null;
722                 if (test0 == null)
723                     rez++;
724                 var test1 = null / a;
725                 if (test1 == null)
726                     rez++;
727                 return rez == 2 ? 0 : 1;
728             }
729         }
730     }
731     // </Code>
732 }
733 
734 
735 
736 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablediv_integereger001.nullandnonnullablediv_integereger001
737 {
738     // <Title>Need to warn on build-in division operator if one op is null and the other is non-nullable.</Title>
739     // <Description>
740     // We should warn whenever one of the builtin nullable operators is used and one op is null and
741     // the other is not a nullable
742     // </Description>
743     // <RelatedBugs></RelatedBugs>
744     //
745     // <Expects Status=success></Expects>
746     //
747     // <Code>
748 
749     namespace Test
750     {
751         public class Program
752         {
753             [Fact]
DynamicCSharpRunTest()754             public static void DynamicCSharpRunTest()
755             {
756                 Assert.Equal(0, MainMethod());
757             }
758 
MainMethod()759             public static int MainMethod()
760             {
761                 int rez = 0;
762                 dynamic a = 5;
763                 var test0 = a / null;
764                 if (test0 == null)
765                     rez++;
766                 var test1 = null / a;
767                 if (test1 == null)
768                     rez++;
769                 return rez == 2 ? 0 : 1;
770             }
771         }
772     }
773     // </Code>
774 }
775 
776 
777 
778 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablediv_lng001.nullandnonnullablediv_lng001
779 {
780     // <Title>Need to warn on build-in division operator if one op is null and the other is non-nullable.</Title>
781     // <Description>
782     // We should warn whenever one of the builtin nullable operators is used and one op is null and
783     // the other is not a nullable
784     // </Description>
785     // <RelatedBugs></RelatedBugs>
786     //
787     // <Expects Status=success></Expects>
788     //
789     // <Code>
790 
791     namespace Test
792     {
793         public class Program
794         {
795             [Fact]
DynamicCSharpRunTest()796             public static void DynamicCSharpRunTest()
797             {
798                 Assert.Equal(0, MainMethod());
799             }
800 
MainMethod()801             public static int MainMethod()
802             {
803                 int rez = 0;
804                 dynamic a = 5L;
805                 var test0 = a / null;
806                 if (test0 == null)
807                     rez++;
808                 var test1 = null / a;
809                 if (test1 == null)
810                     rez++;
811                 return rez == 2 ? 0 : 1;
812             }
813         }
814     }
815     // </Code>
816 }
817 
818 
819 
820 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablediv_uintegereger001.nullandnonnullablediv_uintegereger001
821 {
822     // <Title>Need to warn on build-in division operator if one op is null and the other is non-nullable.</Title>
823     // <Description>
824     // We should warn whenever one of the builtin nullable operators is used and one op is null and
825     // the other is not a nullable
826     // </Description>
827     // <RelatedBugs></RelatedBugs>
828     //
829     // <Expects Status=success></Expects>
830     //
831     // <Code>
832 
833     namespace Test
834     {
835         public class Program
836         {
837             [Fact]
DynamicCSharpRunTest()838             public static void DynamicCSharpRunTest()
839             {
840                 Assert.Equal(0, MainMethod());
841             }
842 
MainMethod()843             public static int MainMethod()
844             {
845                 int rez = 0;
846                 dynamic a = 5U;
847                 var test0 = a / null;
848                 if (test0 == null)
849                     rez++;
850                 var test1 = null / a;
851                 if (test1 == null)
852                     rez++;
853                 return rez == 2 ? 0 : 1;
854             }
855         }
856     }
857     // </Code>
858 }
859 
860 
861 
862 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablediv_ulng001.nullandnonnullablediv_ulng001
863 {
864     // <Title>Need to warn on build-in division operator if one op is null and the other is non-nullable.</Title>
865     // <Description>
866     // We should warn whenever one of the builtin nullable operators is used and one op is null and
867     // the other is not a nullable
868     // </Description>
869     // <RelatedBugs></RelatedBugs>
870     //
871     // <Expects Status=success></Expects>
872     //
873     // <Code>
874 
875     namespace Test
876     {
877         public class Program
878         {
879             [Fact]
DynamicCSharpRunTest()880             public static void DynamicCSharpRunTest()
881             {
882                 Assert.Equal(0, MainMethod());
883             }
884 
MainMethod()885             public static int MainMethod()
886             {
887                 int rez = 0;
888                 dynamic a = 5UL;
889                 var test0 = a / null;
890                 if (test0 == null)
891                     rez++;
892                 var test1 = null / a;
893                 if (test1 == null)
894                     rez++;
895                 return rez == 2 ? 0 : 1;
896             }
897         }
898     }
899     // </Code>
900 }
901 
902 
903 
904 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableeq_bol001.nullandnonnullableeq_bol001
905 {
906     // <Title>Need to warn on build-in equal comparison operator if one op is null and the other is non-nullable.</Title>
907     // <Description>
908     // We should warn whenever one of the builtin nullable operators is used and one op is null and
909     // the other is not a nullable
910     // </Description>
911     // <RelatedBugs></RelatedBugs>
912     //
913     // <Expects Status=success></Expects>
914     //
915     // <Code>
916 
917     namespace Test
918     {
919         public class Program
920         {
921             [Fact]
DynamicCSharpRunTest()922             public static void DynamicCSharpRunTest()
923             {
924                 Assert.Equal(0, MainMethod());
925             }
926 
MainMethod()927             public static int MainMethod()
928             {
929                 int rez = 0;
930                 dynamic a = true;
931                 var test0 = a == null;
932                 if (test0 == false)
933                     rez++;
934                 var test1 = null == a;
935                 if (test1 == false)
936                     rez++;
937                 return rez == 2 ? 0 : 1;
938             }
939         }
940     }
941     // </Code>
942 }
943 
944 
945 
946 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableeq_dcml001.nullandnonnullableeq_dcml001
947 {
948     // <Title>Need to warn on build-in equal comparison operator if one op is null and the other is non-nullable.</Title>
949     // <Description>
950     // We should warn whenever one of the builtin nullable operators is used and one op is null and
951     // the other is not a nullable
952     // </Description>
953     // <RelatedBugs></RelatedBugs>
954     //
955     // <Expects Status=success></Expects>
956     //
957     // <Code>
958 
959     namespace Test
960     {
961         public class Program
962         {
963             [Fact]
DynamicCSharpRunTest()964             public static void DynamicCSharpRunTest()
965             {
966                 Assert.Equal(0, MainMethod());
967             }
968 
MainMethod()969             public static int MainMethod()
970             {
971                 int rez = 0;
972                 dynamic a = 5M;
973                 var test0 = a == null;
974                 if (test0 == false)
975                     rez++;
976                 var test1 = null == a;
977                 if (test1 == false)
978                     rez++;
979                 return rez == 2 ? 0 : 1;
980             }
981         }
982     }
983     // </Code>
984 }
985 
986 
987 
988 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableeq_dbl001.nullandnonnullableeq_dbl001
989 {
990     // <Title>Need to warn on build-in equal comparison operator if one op is null and the other is non-nullable.</Title>
991     // <Description>
992     // We should warn whenever one of the builtin nullable operators is used and one op is null and
993     // the other is not a nullable
994     // </Description>
995     // <RelatedBugs></RelatedBugs>
996     //
997     // <Expects Status=success></Expects>
998     //
999     // <Code>
1000 
1001     namespace Test
1002     {
1003         public class Program
1004         {
1005             [Fact]
DynamicCSharpRunTest()1006             public static void DynamicCSharpRunTest()
1007             {
1008                 Assert.Equal(0, MainMethod());
1009             }
1010 
MainMethod()1011             public static int MainMethod()
1012             {
1013                 int rez = 0;
1014                 dynamic a = 5.0D;
1015                 var test0 = a == null;
1016                 if (test0 == false)
1017                     rez++;
1018                 var test1 = null == a;
1019                 if (test1 == false)
1020                     rez++;
1021                 return rez == 2 ? 0 : 1;
1022             }
1023         }
1024     }
1025     // </Code>
1026 }
1027 
1028 
1029 
1030 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableeq_enum001.nullandnonnullableeq_enum001
1031 {
1032     // <Title>Need to warn on build-in equal comparison operator if one op is null and the other is non-nullable.</Title>
1033     // <Description>
1034     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1035     // the other is not a nullable
1036     // </Description>
1037     // <RelatedBugs></RelatedBugs>
1038     //
1039     // <Expects Status=success></Expects>
1040     //
1041     // <Code>
1042 
1043     namespace Test
1044     {
1045         public class Program
1046         {
1047             [Fact]
DynamicCSharpRunTest()1048             public static void DynamicCSharpRunTest()
1049             {
1050                 Assert.Equal(0, MainMethod());
1051             }
1052 
MainMethod()1053             public static int MainMethod()
1054             {
1055                 int rez = 0;
1056                 dynamic a = Colors.red;
1057                 var test0 = a == null;
1058                 if (test0 == false)
1059                     rez++;
1060                 var test1 = null == a;
1061                 if (test1 == false)
1062                     rez++;
1063                 return rez == 2 ? 0 : 1;
1064             }
1065 
1066             public enum Colors
1067             {
1068                 red,
1069                 green,
1070                 blue
1071             }
1072         }
1073     }
1074     // </Code>
1075 }
1076 
1077 
1078 
1079 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableeq_flt001.nullandnonnullableeq_flt001
1080 {
1081     // <Title>Need to warn on build-in equal comparison operator if one op is null and the other is non-nullable.</Title>
1082     // <Description>
1083     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1084     // the other is not a nullable
1085     // </Description>
1086     // <RelatedBugs></RelatedBugs>
1087     //
1088     // <Expects Status=success></Expects>
1089     //
1090     // <Code>
1091 
1092     namespace Test
1093     {
1094         public class Program
1095         {
1096             [Fact]
DynamicCSharpRunTest()1097             public static void DynamicCSharpRunTest()
1098             {
1099                 Assert.Equal(0, MainMethod());
1100             }
1101 
MainMethod()1102             public static int MainMethod()
1103             {
1104                 int rez = 0;
1105                 dynamic a = 5.0F;
1106                 var test0 = a == null;
1107                 if (test0 == false)
1108                     rez++;
1109                 var test1 = null == a;
1110                 if (test1 == false)
1111                     rez++;
1112                 return rez == 2 ? 0 : 1;
1113             }
1114         }
1115     }
1116     // </Code>
1117 }
1118 
1119 
1120 
1121 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableeq_integereger001.nullandnonnullableeq_integereger001
1122 {
1123     // <Title>Need to warn on build-in equal comparison operator if one op is null and the other is non-nullable.</Title>
1124     // <Description>
1125     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1126     // the other is not a nullable
1127     // </Description>
1128     // <RelatedBugs></RelatedBugs>
1129     //
1130     // <Expects Status=success></Expects>
1131     //
1132     // <Code>
1133 
1134     namespace Test
1135     {
1136         public class Program
1137         {
1138             [Fact]
DynamicCSharpRunTest()1139             public static void DynamicCSharpRunTest()
1140             {
1141                 Assert.Equal(0, MainMethod());
1142             }
1143 
MainMethod()1144             public static int MainMethod()
1145             {
1146                 int rez = 0;
1147                 dynamic a = 5;
1148                 var test0 = a == null;
1149                 if (test0 == false)
1150                     rez++;
1151                 var test1 = null == a;
1152                 if (test1 == false)
1153                     rez++;
1154                 return rez == 2 ? 0 : 1;
1155             }
1156         }
1157     }
1158     // </Code>
1159 }
1160 
1161 
1162 
1163 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableeq_lng001.nullandnonnullableeq_lng001
1164 {
1165     // <Title>Need to warn on build-in equal comparison operator if one op is null and the other is non-nullable.</Title>
1166     // <Description>
1167     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1168     // the other is not a nullable
1169     // </Description>
1170     // <RelatedBugs></RelatedBugs>
1171     //
1172     // <Expects Status=success></Expects>
1173     //
1174     // <Code>
1175 
1176     namespace Test
1177     {
1178         public class Program
1179         {
1180             [Fact]
DynamicCSharpRunTest()1181             public static void DynamicCSharpRunTest()
1182             {
1183                 Assert.Equal(0, MainMethod());
1184             }
1185 
MainMethod()1186             public static int MainMethod()
1187             {
1188                 int rez = 0;
1189                 dynamic a = 5L;
1190                 var test0 = a == null;
1191                 if (test0 == false)
1192                     rez++;
1193                 var test1 = null == a;
1194                 if (test1 == false)
1195                     rez++;
1196                 return rez == 2 ? 0 : 1;
1197             }
1198         }
1199     }
1200     // </Code>
1201 }
1202 
1203 
1204 
1205 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableeq_uintegereger001.nullandnonnullableeq_uintegereger001
1206 {
1207     // <Title>Need to warn on build-in equal comparison operator if one op is null and the other is non-nullable.</Title>
1208     // <Description>
1209     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1210     // the other is not a nullable
1211     // </Description>
1212     // <RelatedBugs></RelatedBugs>
1213     //
1214     // <Expects Status=success></Expects>
1215     //
1216     // <Code>
1217 
1218     namespace Test
1219     {
1220         public class Program
1221         {
1222             [Fact]
DynamicCSharpRunTest()1223             public static void DynamicCSharpRunTest()
1224             {
1225                 Assert.Equal(0, MainMethod());
1226             }
1227 
MainMethod()1228             public static int MainMethod()
1229             {
1230                 int rez = 0;
1231                 dynamic a = 5U;
1232                 var test0 = a == null;
1233                 if (test0 == false)
1234                     rez++;
1235                 var test1 = null == a;
1236                 if (test1 == false)
1237                     rez++;
1238                 return rez == 2 ? 0 : 1;
1239             }
1240         }
1241     }
1242     // </Code>
1243 }
1244 
1245 
1246 
1247 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableeq_ulng001.nullandnonnullableeq_ulng001
1248 {
1249     // <Title>Need to warn on build-in equal comparison operator if one op is null and the other is non-nullable.</Title>
1250     // <Description>
1251     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1252     // the other is not a nullable
1253     // </Description>
1254     // <RelatedBugs></RelatedBugs>
1255     //
1256     // <Expects Status=success></Expects>
1257     //
1258     // <Code>
1259 
1260     namespace Test
1261     {
1262         public class Program
1263         {
1264             [Fact]
DynamicCSharpRunTest()1265             public static void DynamicCSharpRunTest()
1266             {
1267                 Assert.Equal(0, MainMethod());
1268             }
1269 
MainMethod()1270             public static int MainMethod()
1271             {
1272                 int rez = 0;
1273                 dynamic a = 5UL;
1274                 var test0 = a == null;
1275                 if (test0 == false)
1276                     rez++;
1277                 var test1 = null == a;
1278                 if (test1 == false)
1279                     rez++;
1280                 return rez == 2 ? 0 : 1;
1281             }
1282         }
1283     }
1284     // </Code>
1285 }
1286 
1287 
1288 
1289 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablege_dcml001.nullandnonnullablege_dcml001
1290 {
1291     // <Title>Need to warn on build-in greater than or equal comparison operator if one op is null and the other is non-nullable.</Title>
1292     // <Description>
1293     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1294     // the other is not a nullable
1295     // </Description>
1296     // <RelatedBugs></RelatedBugs>
1297     //
1298     // <Expects Status=success></Expects>
1299     //
1300     // <Code>
1301 
1302     namespace Test
1303     {
1304         public class Program
1305         {
1306             [Fact]
DynamicCSharpRunTest()1307             public static void DynamicCSharpRunTest()
1308             {
1309                 Assert.Equal(0, MainMethod());
1310             }
1311 
MainMethod()1312             public static int MainMethod()
1313             {
1314                 int rez = 0;
1315                 dynamic a = 5M;
1316                 var test0 = a >= null;
1317                 if (test0 == false)
1318                     rez++;
1319                 var test1 = null >= a;
1320                 if (test1 == false)
1321                     rez++;
1322                 return rez == 2 ? 0 : 1;
1323             }
1324         }
1325     }
1326     // </Code>
1327 }
1328 
1329 
1330 
1331 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablege_dbl001.nullandnonnullablege_dbl001
1332 {
1333     // <Title>Need to warn on build-in greater than or equal comparison operator if one op is null and the other is non-nullable.</Title>
1334     // <Description>
1335     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1336     // the other is not a nullable
1337     // </Description>
1338     // <RelatedBugs></RelatedBugs>
1339     //
1340     // <Expects Status=success></Expects>
1341     //
1342     // <Code>
1343 
1344     namespace Test
1345     {
1346         public class Program
1347         {
1348             [Fact]
DynamicCSharpRunTest()1349             public static void DynamicCSharpRunTest()
1350             {
1351                 Assert.Equal(0, MainMethod());
1352             }
1353 
MainMethod()1354             public static int MainMethod()
1355             {
1356                 int rez = 0;
1357                 dynamic a = 5.0D;
1358                 var test0 = a >= null;
1359                 if (test0 == false)
1360                     rez++;
1361                 var test1 = null >= a;
1362                 if (test1 == false)
1363                     rez++;
1364                 return rez == 2 ? 0 : 1;
1365             }
1366         }
1367     }
1368     // </Code>
1369 }
1370 
1371 
1372 
1373 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablege_enum001.nullandnonnullablege_enum001
1374 {
1375     // <Title>Need to warn on build-in greater than or equal comparison operator if one op is null and the other is non-nullable.</Title>
1376     // <Description>
1377     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1378     // the other is not a nullable
1379     // </Description>
1380     // <RelatedBugs></RelatedBugs>
1381     //
1382     // <Expects Status=success></Expects>
1383     //
1384     // <Code>
1385 
1386     namespace Test
1387     {
1388         public class Program
1389         {
1390             [Fact]
DynamicCSharpRunTest()1391             public static void DynamicCSharpRunTest()
1392             {
1393                 Assert.Equal(0, MainMethod());
1394             }
1395 
MainMethod()1396             public static int MainMethod()
1397             {
1398                 int rez = 0;
1399                 dynamic a = Colors.red;
1400                 var test0 = a >= null;
1401                 if (test0 == false)
1402                     rez++;
1403                 var test1 = null >= a;
1404                 if (test1 == false)
1405                     rez++;
1406                 return rez == 2 ? 0 : 1;
1407             }
1408 
1409             public enum Colors
1410             {
1411                 red,
1412                 green,
1413                 blue
1414             }
1415         }
1416     }
1417     // </Code>
1418 }
1419 
1420 
1421 
1422 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablege_flt001.nullandnonnullablege_flt001
1423 {
1424     // <Title>Need to warn on build-in greater than or equal comparison operator if one op is null and the other is non-nullable.</Title>
1425     // <Description>
1426     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1427     // the other is not a nullable
1428     // </Description>
1429     // <RelatedBugs></RelatedBugs>
1430     //
1431     // <Expects Status=success></Expects>
1432     //
1433     // <Code>
1434 
1435     namespace Test
1436     {
1437         public class Program
1438         {
1439             [Fact]
DynamicCSharpRunTest()1440             public static void DynamicCSharpRunTest()
1441             {
1442                 Assert.Equal(0, MainMethod());
1443             }
1444 
MainMethod()1445             public static int MainMethod()
1446             {
1447                 int rez = 0;
1448                 dynamic a = 5.0F;
1449                 var test0 = a >= null;
1450                 if (test0 == false)
1451                     rez++;
1452                 var test1 = null >= a;
1453                 if (test1 == false)
1454                     rez++;
1455                 return rez == 2 ? 0 : 1;
1456             }
1457         }
1458     }
1459     // </Code>
1460 }
1461 
1462 
1463 
1464 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablege_integereger001.nullandnonnullablege_integereger001
1465 {
1466     // <Title>Need to warn on build-in greater than or equal comparison operator if one op is null and the other is non-nullable.</Title>
1467     // <Description>
1468     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1469     // the other is not a nullable
1470     // </Description>
1471     // <RelatedBugs></RelatedBugs>
1472     //
1473     // <Expects Status=success></Expects>
1474     //
1475     // <Code>
1476 
1477     namespace Test
1478     {
1479         public class Program
1480         {
1481             [Fact]
DynamicCSharpRunTest()1482             public static void DynamicCSharpRunTest()
1483             {
1484                 Assert.Equal(0, MainMethod());
1485             }
1486 
MainMethod()1487             public static int MainMethod()
1488             {
1489                 int rez = 0;
1490                 dynamic a = 5;
1491                 var test0 = a >= null;
1492                 if (test0 == false)
1493                     rez++;
1494                 var test1 = null >= a;
1495                 if (test1 == false)
1496                     rez++;
1497                 return rez == 2 ? 0 : 1;
1498             }
1499         }
1500     }
1501     // </Code>
1502 }
1503 
1504 
1505 
1506 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablege_lng001.nullandnonnullablege_lng001
1507 {
1508     // <Title>Need to warn on build-in greater than or equal comparison operator if one op is null and the other is non-nullable.</Title>
1509     // <Description>
1510     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1511     // the other is not a nullable
1512     // </Description>
1513     // <RelatedBugs></RelatedBugs>
1514     //
1515     // <Expects Status=success></Expects>
1516     //
1517     // <Code>
1518 
1519     namespace Test
1520     {
1521         public class Program
1522         {
1523             [Fact]
DynamicCSharpRunTest()1524             public static void DynamicCSharpRunTest()
1525             {
1526                 Assert.Equal(0, MainMethod());
1527             }
1528 
MainMethod()1529             public static int MainMethod()
1530             {
1531                 int rez = 0;
1532                 dynamic a = 5L;
1533                 var test0 = a >= null;
1534                 if (test0 == false)
1535                     rez++;
1536                 var test1 = null >= a;
1537                 if (test1 == false)
1538                     rez++;
1539                 return rez == 2 ? 0 : 1;
1540             }
1541         }
1542     }
1543     // </Code>
1544 }
1545 
1546 
1547 
1548 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablege_uintegereger001.nullandnonnullablege_uintegereger001
1549 {
1550     // <Title>Need to warn on build-in greater than or equal comparison operator if one op is null and the other is non-nullable.</Title>
1551     // <Description>
1552     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1553     // the other is not a nullable
1554     // </Description>
1555     // <RelatedBugs></RelatedBugs>
1556     //
1557     // <Expects Status=success></Expects>
1558     //
1559     // <Code>
1560 
1561     namespace Test
1562     {
1563         public class Program
1564         {
1565             [Fact]
DynamicCSharpRunTest()1566             public static void DynamicCSharpRunTest()
1567             {
1568                 Assert.Equal(0, MainMethod());
1569             }
1570 
MainMethod()1571             public static int MainMethod()
1572             {
1573                 int rez = 0;
1574                 dynamic a = 5U;
1575                 var test0 = a >= null;
1576                 if (test0 == false)
1577                     rez++;
1578                 var test1 = null >= a;
1579                 if (test1 == false)
1580                     rez++;
1581                 return rez == 2 ? 0 : 1;
1582             }
1583         }
1584     }
1585     // </Code>
1586 }
1587 
1588 
1589 
1590 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablege_ulng001.nullandnonnullablege_ulng001
1591 {
1592     // <Title>Need to warn on build-in greater than or equal comparison operator if one op is null and the other is non-nullable.</Title>
1593     // <Description>
1594     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1595     // the other is not a nullable
1596     // </Description>
1597     // <RelatedBugs></RelatedBugs>
1598     //
1599     // <Expects Status=success></Expects>
1600     //
1601     // <Code>
1602 
1603     namespace Test
1604     {
1605         public class Program
1606         {
1607             [Fact]
DynamicCSharpRunTest()1608             public static void DynamicCSharpRunTest()
1609             {
1610                 Assert.Equal(0, MainMethod());
1611             }
1612 
MainMethod()1613             public static int MainMethod()
1614             {
1615                 int rez = 0;
1616                 dynamic a = 5UL;
1617                 var test0 = a >= null;
1618                 if (test0 == false)
1619                     rez++;
1620                 var test1 = null >= a;
1621                 if (test1 == false)
1622                     rez++;
1623                 return rez == 2 ? 0 : 1;
1624             }
1625         }
1626     }
1627     // </Code>
1628 }
1629 
1630 
1631 
1632 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablegt_dcml001.nullandnonnullablegt_dcml001
1633 {
1634     // <Title>Need to warn on build-in greater than comparison operator if one op is null and the other is non-nullable.</Title>
1635     // <Description>
1636     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1637     // the other is not a nullable
1638     // </Description>
1639     // <RelatedBugs></RelatedBugs>
1640     //
1641     // <Expects Status=success></Expects>
1642     //
1643     // <Code>
1644 
1645     namespace Test
1646     {
1647         public class Program
1648         {
1649             [Fact]
DynamicCSharpRunTest()1650             public static void DynamicCSharpRunTest()
1651             {
1652                 Assert.Equal(0, MainMethod());
1653             }
1654 
MainMethod()1655             public static int MainMethod()
1656             {
1657                 int rez = 0;
1658                 dynamic a = 5M;
1659                 var test0 = a > null;
1660                 if (test0 == false)
1661                     rez++;
1662                 var test1 = null > a;
1663                 if (test1 == false)
1664                     rez++;
1665                 return rez == 2 ? 0 : 1;
1666             }
1667         }
1668     }
1669     // </Code>
1670 }
1671 
1672 
1673 
1674 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablegt_dbl001.nullandnonnullablegt_dbl001
1675 {
1676     // <Title>Need to warn on build-in greater than comparison operator if one op is null and the other is non-nullable.</Title>
1677     // <Description>
1678     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1679     // the other is not a nullable
1680     // </Description>
1681     // <RelatedBugs></RelatedBugs>
1682     //
1683     // <Expects Status=success></Expects>
1684     //
1685     // <Code>
1686 
1687     namespace Test
1688     {
1689         public class Program
1690         {
1691             [Fact]
DynamicCSharpRunTest()1692             public static void DynamicCSharpRunTest()
1693             {
1694                 Assert.Equal(0, MainMethod());
1695             }
1696 
MainMethod()1697             public static int MainMethod()
1698             {
1699                 int rez = 0;
1700                 dynamic a = 5.0D;
1701                 var test0 = a > null;
1702                 if (test0 == false)
1703                     rez++;
1704                 var test1 = null > a;
1705                 if (test1 == false)
1706                     rez++;
1707                 return rez == 2 ? 0 : 1;
1708             }
1709         }
1710     }
1711     // </Code>
1712 }
1713 
1714 
1715 
1716 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablegt_enum001.nullandnonnullablegt_enum001
1717 {
1718     // <Title>Need to warn on build-in greater than comparison operator if one op is null and the other is non-nullable.</Title>
1719     // <Description>
1720     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1721     // the other is not a nullable
1722     // </Description>
1723     // <RelatedBugs></RelatedBugs>
1724     //
1725     // <Expects Status=success></Expects>
1726     //
1727     // <Code>
1728 
1729     namespace Test
1730     {
1731         public class Program
1732         {
1733             [Fact]
DynamicCSharpRunTest()1734             public static void DynamicCSharpRunTest()
1735             {
1736                 Assert.Equal(0, MainMethod());
1737             }
1738 
MainMethod()1739             public static int MainMethod()
1740             {
1741                 int rez = 0;
1742                 dynamic a = Colors.red;
1743                 var test0 = a > null;
1744                 if (test0 == false)
1745                     rez++;
1746                 var test1 = null > a;
1747                 if (test1 == false)
1748                     rez++;
1749                 return rez == 2 ? 0 : 1;
1750             }
1751 
1752             public enum Colors
1753             {
1754                 red,
1755                 green,
1756                 blue
1757             }
1758         }
1759     }
1760     // </Code>
1761 }
1762 
1763 
1764 
1765 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablegt_flt001.nullandnonnullablegt_flt001
1766 {
1767     // <Title>Need to warn on build-in greater than comparison operator if one op is null and the other is non-nullable.</Title>
1768     // <Description>
1769     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1770     // the other is not a nullable
1771     // </Description>
1772     // <RelatedBugs></RelatedBugs>
1773     //
1774     // <Expects Status=success></Expects>
1775     //
1776     // <Code>
1777 
1778     namespace Test
1779     {
1780         public class Program
1781         {
1782             [Fact]
DynamicCSharpRunTest()1783             public static void DynamicCSharpRunTest()
1784             {
1785                 Assert.Equal(0, MainMethod());
1786             }
1787 
MainMethod()1788             public static int MainMethod()
1789             {
1790                 int rez = 0;
1791                 dynamic a = 5.0F;
1792                 var test0 = a > null;
1793                 if (test0 == false)
1794                     rez++;
1795                 var test1 = null > a;
1796                 if (test1 == false)
1797                     rez++;
1798                 return rez == 2 ? 0 : 1;
1799             }
1800         }
1801     }
1802     // </Code>
1803 }
1804 
1805 
1806 
1807 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablegt_integereger001.nullandnonnullablegt_integereger001
1808 {
1809     // <Title>Need to warn on build-in greater than comparison operator if one op is null and the other is non-nullable.</Title>
1810     // <Description>
1811     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1812     // the other is not a nullable
1813     // </Description>
1814     // <RelatedBugs></RelatedBugs>
1815     //
1816     // <Expects Status=success></Expects>
1817     //
1818     // <Code>
1819 
1820     namespace Test
1821     {
1822         public class Program
1823         {
1824             [Fact]
DynamicCSharpRunTest()1825             public static void DynamicCSharpRunTest()
1826             {
1827                 Assert.Equal(0, MainMethod());
1828             }
1829 
MainMethod()1830             public static int MainMethod()
1831             {
1832                 int rez = 0;
1833                 dynamic a = 5;
1834                 var test0 = a > null;
1835                 if (test0 == false)
1836                     rez++;
1837                 var test1 = null > a;
1838                 if (test1 == false)
1839                     rez++;
1840                 return rez == 2 ? 0 : 1;
1841             }
1842         }
1843     }
1844     // </Code>
1845 }
1846 
1847 
1848 
1849 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablegt_lng001.nullandnonnullablegt_lng001
1850 {
1851     // <Title>Need to warn on build-in greater than comparison operator if one op is null and the other is non-nullable.</Title>
1852     // <Description>
1853     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1854     // the other is not a nullable
1855     // </Description>
1856     // <RelatedBugs></RelatedBugs>
1857     //
1858     // <Expects Status=success></Expects>
1859     //
1860     // <Code>
1861 
1862     namespace Test
1863     {
1864         public class Program
1865         {
1866             [Fact]
DynamicCSharpRunTest()1867             public static void DynamicCSharpRunTest()
1868             {
1869                 Assert.Equal(0, MainMethod());
1870             }
1871 
MainMethod()1872             public static int MainMethod()
1873             {
1874                 int rez = 0;
1875                 dynamic a = 5L;
1876                 var test0 = a > null;
1877                 if (test0 == false)
1878                     rez++;
1879                 var test1 = null > a;
1880                 if (test1 == false)
1881                     rez++;
1882                 return rez == 2 ? 0 : 1;
1883             }
1884         }
1885     }
1886     // </Code>
1887 }
1888 
1889 
1890 
1891 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablegt_uintegereger001.nullandnonnullablegt_uintegereger001
1892 {
1893     // <Title>Need to warn on build-in greater than comparison operator if one op is null and the other is non-nullable.</Title>
1894     // <Description>
1895     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1896     // the other is not a nullable
1897     // </Description>
1898     // <RelatedBugs></RelatedBugs>
1899     //
1900     // <Expects Status=success></Expects>
1901     //
1902     // <Code>
1903 
1904     namespace Test
1905     {
1906         public class Program
1907         {
1908             [Fact]
DynamicCSharpRunTest()1909             public static void DynamicCSharpRunTest()
1910             {
1911                 Assert.Equal(0, MainMethod());
1912             }
1913 
MainMethod()1914             public static int MainMethod()
1915             {
1916                 int rez = 0;
1917                 dynamic a = 5U;
1918                 var test0 = a > null;
1919                 if (test0 == false)
1920                     rez++;
1921                 var test1 = null > a;
1922                 if (test1 == false)
1923                     rez++;
1924                 return rez == 2 ? 0 : 1;
1925             }
1926         }
1927     }
1928     // </Code>
1929 }
1930 
1931 
1932 
1933 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablegt_ulng001.nullandnonnullablegt_ulng001
1934 {
1935     // <Title>Need to warn on build-in greater than comparison operator if one op is null and the other is non-nullable.</Title>
1936     // <Description>
1937     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1938     // the other is not a nullable
1939     // </Description>
1940     // <RelatedBugs></RelatedBugs>
1941     //
1942     // <Expects Status=success></Expects>
1943     //
1944     // <Code>
1945 
1946     namespace Test
1947     {
1948         public class Program
1949         {
1950             [Fact]
DynamicCSharpRunTest()1951             public static void DynamicCSharpRunTest()
1952             {
1953                 Assert.Equal(0, MainMethod());
1954             }
1955 
MainMethod()1956             public static int MainMethod()
1957             {
1958                 int rez = 0;
1959                 dynamic a = 5UL;
1960                 var test0 = a > null;
1961                 if (test0 == false)
1962                     rez++;
1963                 var test1 = null > a;
1964                 if (test1 == false)
1965                     rez++;
1966                 return rez == 2 ? 0 : 1;
1967             }
1968         }
1969     }
1970     // </Code>
1971 }
1972 
1973 
1974 
1975 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablele_dcml001.nullandnonnullablele_dcml001
1976 {
1977     // <Title>Need to warn on build-in less than or equal comparison operator if one op is null and the other is non-nullable.</Title>
1978     // <Description>
1979     // We should warn whenever one of the builtin nullable operators is used and one op is null and
1980     // the other is not a nullable
1981     // </Description>
1982     // <RelatedBugs></RelatedBugs>
1983     //
1984     // <Expects Status=success></Expects>
1985     //
1986     // <Code>
1987 
1988     namespace Test
1989     {
1990         public class Program
1991         {
1992             [Fact]
DynamicCSharpRunTest()1993             public static void DynamicCSharpRunTest()
1994             {
1995                 Assert.Equal(0, MainMethod());
1996             }
1997 
MainMethod()1998             public static int MainMethod()
1999             {
2000                 int rez = 0;
2001                 dynamic a = 5M;
2002                 var test0 = a <= null;
2003                 if (test0 == false)
2004                     rez++;
2005                 var test1 = null <= a;
2006                 if (test1 == false)
2007                     rez++;
2008                 return rez == 2 ? 0 : 1;
2009             }
2010         }
2011     }
2012     // </Code>
2013 }
2014 
2015 
2016 
2017 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablele_dbl001.nullandnonnullablele_dbl001
2018 {
2019     // <Title>Need to warn on build-in less than or equal comparison operator if one op is null and the other is non-nullable.</Title>
2020     // <Description>
2021     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2022     // the other is not a nullable
2023     // </Description>
2024     // <RelatedBugs></RelatedBugs>
2025     //
2026     // <Expects Status=success></Expects>
2027     //
2028     // <Code>
2029 
2030     namespace Test
2031     {
2032         public class Program
2033         {
2034             [Fact]
DynamicCSharpRunTest()2035             public static void DynamicCSharpRunTest()
2036             {
2037                 Assert.Equal(0, MainMethod());
2038             }
2039 
MainMethod()2040             public static int MainMethod()
2041             {
2042                 int rez = 0;
2043                 dynamic a = 5.0D;
2044                 var test0 = a <= null;
2045                 if (test0 == false)
2046                     rez++;
2047                 var test1 = null <= a;
2048                 if (test1 == false)
2049                     rez++;
2050                 return rez == 2 ? 0 : 1;
2051             }
2052         }
2053     }
2054     // </Code>
2055 }
2056 
2057 
2058 
2059 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablele_enum001.nullandnonnullablele_enum001
2060 {
2061     // <Title>Need to warn on build-in less than or equal comparison operator if one op is null and the other is non-nullable.</Title>
2062     // <Description>
2063     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2064     // the other is not a nullable
2065     // </Description>
2066     // <RelatedBugs></RelatedBugs>
2067     //
2068     // <Expects Status=success></Expects>
2069     //
2070     // <Code>
2071 
2072     namespace Test
2073     {
2074         public class Program
2075         {
2076             [Fact]
DynamicCSharpRunTest()2077             public static void DynamicCSharpRunTest()
2078             {
2079                 Assert.Equal(0, MainMethod());
2080             }
2081 
MainMethod()2082             public static int MainMethod()
2083             {
2084                 int rez = 0;
2085                 dynamic a = Colors.red;
2086                 var test0 = a <= null;
2087                 if (test0 == false)
2088                     rez++;
2089                 var test1 = null <= a;
2090                 if (test1 == false)
2091                     rez++;
2092                 return rez == 2 ? 0 : 1;
2093             }
2094 
2095             public enum Colors
2096             {
2097                 red,
2098                 green,
2099                 blue
2100             }
2101         }
2102     }
2103     // </Code>
2104 }
2105 
2106 
2107 
2108 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablele_flt001.nullandnonnullablele_flt001
2109 {
2110     // <Title>Need to warn on build-in less than or equal comparison operator if one op is null and the other is non-nullable.</Title>
2111     // <Description>
2112     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2113     // the other is not a nullable
2114     // </Description>
2115     // <RelatedBugs></RelatedBugs>
2116     //
2117     // <Expects Status=success></Expects>
2118     //
2119     // <Code>
2120 
2121     namespace Test
2122     {
2123         public class Program
2124         {
2125             [Fact]
DynamicCSharpRunTest()2126             public static void DynamicCSharpRunTest()
2127             {
2128                 Assert.Equal(0, MainMethod());
2129             }
2130 
MainMethod()2131             public static int MainMethod()
2132             {
2133                 int rez = 0;
2134                 dynamic a = 5.0F;
2135                 var test0 = a <= null;
2136                 if (test0 == false)
2137                     rez++;
2138                 var test1 = null <= a;
2139                 if (test1 == false)
2140                     rez++;
2141                 return rez == 2 ? 0 : 1;
2142             }
2143         }
2144     }
2145     // </Code>
2146 }
2147 
2148 
2149 
2150 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablele_integereger001.nullandnonnullablele_integereger001
2151 {
2152     // <Title>Need to warn on build-in less than or equal comparison operator if one op is null and the other is non-nullable.</Title>
2153     // <Description>
2154     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2155     // the other is not a nullable
2156     // </Description>
2157     // <RelatedBugs></RelatedBugs>
2158     //
2159     // <Expects Status=success></Expects>
2160     //
2161     // <Code>
2162 
2163     namespace Test
2164     {
2165         public class Program
2166         {
2167             [Fact]
DynamicCSharpRunTest()2168             public static void DynamicCSharpRunTest()
2169             {
2170                 Assert.Equal(0, MainMethod());
2171             }
2172 
MainMethod()2173             public static int MainMethod()
2174             {
2175                 int rez = 0;
2176                 dynamic a = 5;
2177                 var test0 = a <= null;
2178                 if (test0 == false)
2179                     rez++;
2180                 var test1 = null <= a;
2181                 if (test1 == false)
2182                     rez++;
2183                 return rez == 2 ? 0 : 1;
2184             }
2185         }
2186     }
2187     // </Code>
2188 }
2189 
2190 
2191 
2192 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablele_lng001.nullandnonnullablele_lng001
2193 {
2194     // <Title>Need to warn on build-in less than or equal comparison operator if one op is null and the other is non-nullable.</Title>
2195     // <Description>
2196     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2197     // the other is not a nullable
2198     // </Description>
2199     // <RelatedBugs></RelatedBugs>
2200     //
2201     // <Expects Status=success></Expects>
2202     //
2203     // <Code>
2204 
2205     namespace Test
2206     {
2207         public class Program
2208         {
2209             [Fact]
DynamicCSharpRunTest()2210             public static void DynamicCSharpRunTest()
2211             {
2212                 Assert.Equal(0, MainMethod());
2213             }
2214 
MainMethod()2215             public static int MainMethod()
2216             {
2217                 int rez = 0;
2218                 dynamic a = 5L;
2219                 var test0 = a <= null;
2220                 if (test0 == false)
2221                     rez++;
2222                 var test1 = null <= a;
2223                 if (test1 == false)
2224                     rez++;
2225                 return rez == 2 ? 0 : 1;
2226             }
2227         }
2228     }
2229     // </Code>
2230 }
2231 
2232 
2233 
2234 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablele_uintegereger001.nullandnonnullablele_uintegereger001
2235 {
2236     // <Title>Need to warn on build-in less than or equal comparison operator if one op is null and the other is non-nullable.</Title>
2237     // <Description>
2238     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2239     // the other is not a nullable
2240     // </Description>
2241     // <RelatedBugs></RelatedBugs>
2242     //
2243     // <Expects Status=success></Expects>
2244     //
2245     // <Code>
2246 
2247     namespace Test
2248     {
2249         public class Program
2250         {
2251             [Fact]
DynamicCSharpRunTest()2252             public static void DynamicCSharpRunTest()
2253             {
2254                 Assert.Equal(0, MainMethod());
2255             }
2256 
MainMethod()2257             public static int MainMethod()
2258             {
2259                 int rez = 0;
2260                 dynamic a = 5U;
2261                 var test0 = a <= null;
2262                 if (test0 == false)
2263                     rez++;
2264                 var test1 = null <= a;
2265                 if (test1 == false)
2266                     rez++;
2267                 return rez == 2 ? 0 : 1;
2268             }
2269         }
2270     }
2271     // </Code>
2272 }
2273 
2274 
2275 
2276 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablele_ulng001.nullandnonnullablele_ulng001
2277 {
2278     // <Title>Need to warn on build-in less than or equal comparison operator if one op is null and the other is non-nullable.</Title>
2279     // <Description>
2280     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2281     // the other is not a nullable
2282     // </Description>
2283     // <RelatedBugs></RelatedBugs>
2284     //
2285     // <Expects Status=success></Expects>
2286     //
2287     // <Code>
2288 
2289     namespace Test
2290     {
2291         public class Program
2292         {
2293             [Fact]
DynamicCSharpRunTest()2294             public static void DynamicCSharpRunTest()
2295             {
2296                 Assert.Equal(0, MainMethod());
2297             }
2298 
MainMethod()2299             public static int MainMethod()
2300             {
2301                 int rez = 0;
2302                 dynamic a = 5UL;
2303                 var test0 = a <= null;
2304                 if (test0 == false)
2305                     rez++;
2306                 var test1 = null <= a;
2307                 if (test1 == false)
2308                     rez++;
2309                 return rez == 2 ? 0 : 1;
2310             }
2311         }
2312     }
2313     // </Code>
2314 }
2315 
2316 
2317 
2318 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablelt_dcml001.nullandnonnullablelt_dcml001
2319 {
2320     // <Title>Need to warn on build-in less than comparison operator if one op is null and the other is non-nullable.</Title>
2321     // <Description>
2322     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2323     // the other is not a nullable
2324     // </Description>
2325     // <RelatedBugs></RelatedBugs>
2326     //
2327     // <Expects Status=success></Expects>
2328     //
2329     // <Code>
2330 
2331     namespace Test
2332     {
2333         public class Program
2334         {
2335             [Fact]
DynamicCSharpRunTest()2336             public static void DynamicCSharpRunTest()
2337             {
2338                 Assert.Equal(0, MainMethod());
2339             }
2340 
MainMethod()2341             public static int MainMethod()
2342             {
2343                 int rez = 0;
2344                 dynamic a = 5M;
2345                 var test0 = a < null;
2346                 if (test0 == false)
2347                     rez++;
2348                 var test1 = null < a;
2349                 if (test1 == false)
2350                     rez++;
2351                 return rez == 2 ? 0 : 1;
2352             }
2353         }
2354     }
2355     // </Code>
2356 }
2357 
2358 
2359 
2360 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablelt_dbl001.nullandnonnullablelt_dbl001
2361 {
2362     // <Title>Need to warn on build-in less than comparison operator if one op is null and the other is non-nullable.</Title>
2363     // <Description>
2364     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2365     // the other is not a nullable
2366     // </Description>
2367     // <RelatedBugs></RelatedBugs>
2368     //
2369     // <Expects Status=success></Expects>
2370     //
2371     // <Code>
2372 
2373     namespace Test
2374     {
2375         public class Program
2376         {
2377             [Fact]
DynamicCSharpRunTest()2378             public static void DynamicCSharpRunTest()
2379             {
2380                 Assert.Equal(0, MainMethod());
2381             }
2382 
MainMethod()2383             public static int MainMethod()
2384             {
2385                 int rez = 0;
2386                 dynamic a = 5.0D;
2387                 var test0 = a < null;
2388                 if (test0 == false)
2389                     rez++;
2390                 var test1 = null < a;
2391                 if (test1 == false)
2392                     rez++;
2393                 return rez == 2 ? 0 : 1;
2394             }
2395         }
2396     }
2397     // </Code>
2398 }
2399 
2400 
2401 
2402 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablelt_enum001.nullandnonnullablelt_enum001
2403 {
2404     // <Title>Need to warn on build-in less than comparison operator if one op is null and the other is non-nullable.</Title>
2405     // <Description>
2406     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2407     // the other is not a nullable
2408     // </Description>
2409     // <RelatedBugs></RelatedBugs>
2410     //
2411     // <Expects Status=success></Expects>
2412     //
2413     // <Code>
2414 
2415     namespace Test
2416     {
2417         public class Program
2418         {
2419             [Fact]
DynamicCSharpRunTest()2420             public static void DynamicCSharpRunTest()
2421             {
2422                 Assert.Equal(0, MainMethod());
2423             }
2424 
MainMethod()2425             public static int MainMethod()
2426             {
2427                 int rez = 0;
2428                 dynamic a = Colors.red;
2429                 var test0 = a < null;
2430                 if (test0 == false)
2431                     rez++;
2432                 var test1 = null < a;
2433                 if (test1 == false)
2434                     rez++;
2435                 return rez == 2 ? 0 : 1;
2436             }
2437 
2438             public enum Colors
2439             {
2440                 red,
2441                 green,
2442                 blue
2443             }
2444         }
2445     }
2446     // </Code>
2447 }
2448 
2449 
2450 
2451 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablelt_flt001.nullandnonnullablelt_flt001
2452 {
2453     // <Title>Need to warn on build-in less than comparison operator if one op is null and the other is non-nullable.</Title>
2454     // <Description>
2455     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2456     // the other is not a nullable
2457     // </Description>
2458     // <RelatedBugs></RelatedBugs>
2459     //
2460     // <Expects Status=success></Expects>
2461     //
2462     // <Code>
2463 
2464     namespace Test
2465     {
2466         public class Program
2467         {
2468             [Fact]
DynamicCSharpRunTest()2469             public static void DynamicCSharpRunTest()
2470             {
2471                 Assert.Equal(0, MainMethod());
2472             }
2473 
MainMethod()2474             public static int MainMethod()
2475             {
2476                 int rez = 0;
2477                 dynamic a = 5.0F;
2478                 var test0 = a < null;
2479                 if (test0 == false)
2480                     rez++;
2481                 var test1 = null < a;
2482                 if (test1 == false)
2483                     rez++;
2484                 return rez == 2 ? 0 : 1;
2485             }
2486         }
2487     }
2488     // </Code>
2489 }
2490 
2491 
2492 
2493 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablelt_integereger001.nullandnonnullablelt_integereger001
2494 {
2495     // <Title>Need to warn on build-in less than comparison operator if one op is null and the other is non-nullable.</Title>
2496     // <Description>
2497     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2498     // the other is not a nullable
2499     // </Description>
2500     // <RelatedBugs></RelatedBugs>
2501     //
2502     // <Expects Status=success></Expects>
2503     //
2504     // <Code>
2505 
2506     namespace Test
2507     {
2508         public class Program
2509         {
2510             [Fact]
DynamicCSharpRunTest()2511             public static void DynamicCSharpRunTest()
2512             {
2513                 Assert.Equal(0, MainMethod());
2514             }
2515 
MainMethod()2516             public static int MainMethod()
2517             {
2518                 int rez = 0;
2519                 dynamic a = 5;
2520                 var test0 = a < null;
2521                 if (test0 == false)
2522                     rez++;
2523                 var test1 = null < a;
2524                 if (test1 == false)
2525                     rez++;
2526                 return rez == 2 ? 0 : 1;
2527             }
2528         }
2529     }
2530     // </Code>
2531 }
2532 
2533 
2534 
2535 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablelt_lng001.nullandnonnullablelt_lng001
2536 {
2537     // <Title>Need to warn on build-in less than comparison operator if one op is null and the other is non-nullable.</Title>
2538     // <Description>
2539     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2540     // the other is not a nullable
2541     // </Description>
2542     // <RelatedBugs></RelatedBugs>
2543     //
2544     // <Expects Status=success></Expects>
2545     //
2546     // <Code>
2547 
2548     namespace Test
2549     {
2550         public class Program
2551         {
2552             [Fact]
DynamicCSharpRunTest()2553             public static void DynamicCSharpRunTest()
2554             {
2555                 Assert.Equal(0, MainMethod());
2556             }
2557 
MainMethod()2558             public static int MainMethod()
2559             {
2560                 int rez = 0;
2561                 dynamic a = 5L;
2562                 var test0 = a < null;
2563                 if (test0 == false)
2564                     rez++;
2565                 var test1 = null < a;
2566                 if (test1 == false)
2567                     rez++;
2568                 return rez == 2 ? 0 : 1;
2569             }
2570         }
2571     }
2572     // </Code>
2573 }
2574 
2575 
2576 
2577 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablelt_uintegereger001.nullandnonnullablelt_uintegereger001
2578 {
2579     // <Title>Need to warn on build-in less than comparison operator if one op is null and the other is non-nullable.</Title>
2580     // <Description>
2581     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2582     // the other is not a nullable
2583     // </Description>
2584     // <RelatedBugs></RelatedBugs>
2585     //
2586     // <Expects Status=success></Expects>
2587     //
2588     // <Code>
2589 
2590     namespace Test
2591     {
2592         public class Program
2593         {
2594             [Fact]
DynamicCSharpRunTest()2595             public static void DynamicCSharpRunTest()
2596             {
2597                 Assert.Equal(0, MainMethod());
2598             }
2599 
MainMethod()2600             public static int MainMethod()
2601             {
2602                 int rez = 0;
2603                 dynamic a = 5U;
2604                 var test0 = a < null;
2605                 if (test0 == false)
2606                     rez++;
2607                 var test1 = null < a;
2608                 if (test1 == false)
2609                     rez++;
2610                 return rez == 2 ? 0 : 1;
2611             }
2612         }
2613     }
2614     // </Code>
2615 }
2616 
2617 
2618 
2619 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablelt_ulng001.nullandnonnullablelt_ulng001
2620 {
2621     // <Title>Need to warn on build-in less than comparison operator if one op is null and the other is non-nullable.</Title>
2622     // <Description>
2623     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2624     // the other is not a nullable
2625     // </Description>
2626     // <RelatedBugs></RelatedBugs>
2627     //
2628     // <Expects Status=success></Expects>
2629     //
2630     // <Code>
2631 
2632     namespace Test
2633     {
2634         public class Program
2635         {
2636             [Fact]
DynamicCSharpRunTest()2637             public static void DynamicCSharpRunTest()
2638             {
2639                 Assert.Equal(0, MainMethod());
2640             }
2641 
MainMethod()2642             public static int MainMethod()
2643             {
2644                 int rez = 0;
2645                 dynamic a = 5UL;
2646                 var test0 = a < null;
2647                 if (test0 == false)
2648                     rez++;
2649                 var test1 = null < a;
2650                 if (test1 == false)
2651                     rez++;
2652                 return rez == 2 ? 0 : 1;
2653             }
2654         }
2655     }
2656     // </Code>
2657 }
2658 
2659 
2660 
2661 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablemul_dcml001.nullandnonnullablemul_dcml001
2662 {
2663     // <Title>Need to warn on build-in multiplication operator if one op is null and the other is non-nullable.</Title>
2664     // <Description>
2665     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2666     // the other is not a nullable
2667     // </Description>
2668     // <RelatedBugs></RelatedBugs>
2669     //
2670     // <Expects Status=success></Expects>
2671     //
2672     // <Code>
2673 
2674     namespace Test
2675     {
2676         public class Program
2677         {
2678             [Fact]
DynamicCSharpRunTest()2679             public static void DynamicCSharpRunTest()
2680             {
2681                 Assert.Equal(0, MainMethod());
2682             }
2683 
MainMethod()2684             public static int MainMethod()
2685             {
2686                 int rez = 0;
2687                 dynamic a = 5M;
2688                 var test0 = a * null;
2689                 if (test0 == null)
2690                     rez++;
2691                 var test1 = null * a;
2692                 if (test1 == null)
2693                     rez++;
2694                 return rez == 2 ? 0 : 1;
2695             }
2696         }
2697     }
2698     // </Code>
2699 }
2700 
2701 
2702 
2703 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablemul_dbl001.nullandnonnullablemul_dbl001
2704 {
2705     // <Title>Need to warn on build-in multiplication operator if one op is null and the other is non-nullable.</Title>
2706     // <Description>
2707     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2708     // the other is not a nullable
2709     // </Description>
2710     // <RelatedBugs></RelatedBugs>
2711     //
2712     // <Expects Status=success></Expects>
2713     //
2714     // <Code>
2715 
2716     namespace Test
2717     {
2718         public class Program
2719         {
2720             [Fact]
DynamicCSharpRunTest()2721             public static void DynamicCSharpRunTest()
2722             {
2723                 Assert.Equal(0, MainMethod());
2724             }
2725 
MainMethod()2726             public static int MainMethod()
2727             {
2728                 int rez = 0;
2729                 dynamic a = 5.0D;
2730                 var test0 = a * null;
2731                 if (test0 == null)
2732                     rez++;
2733                 var test1 = null * a;
2734                 if (test1 == null)
2735                     rez++;
2736                 return rez == 2 ? 0 : 1;
2737             }
2738         }
2739     }
2740     // </Code>
2741 }
2742 
2743 
2744 
2745 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablemul_flt001.nullandnonnullablemul_flt001
2746 {
2747     // <Title>Need to warn on build-in multiplication operator if one op is null and the other is non-nullable.</Title>
2748     // <Description>
2749     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2750     // the other is not a nullable
2751     // </Description>
2752     // <RelatedBugs></RelatedBugs>
2753     //
2754     // <Expects Status=success></Expects>
2755     //
2756     // <Code>
2757 
2758     namespace Test
2759     {
2760         public class Program
2761         {
2762             [Fact]
DynamicCSharpRunTest()2763             public static void DynamicCSharpRunTest()
2764             {
2765                 Assert.Equal(0, MainMethod());
2766             }
2767 
MainMethod()2768             public static int MainMethod()
2769             {
2770                 int rez = 0;
2771                 dynamic a = 5.0F;
2772                 var test0 = a * null;
2773                 if (test0 == null)
2774                     rez++;
2775                 var test1 = null * a;
2776                 if (test1 == null)
2777                     rez++;
2778                 return rez == 2 ? 0 : 1;
2779             }
2780         }
2781     }
2782     // </Code>
2783 }
2784 
2785 
2786 
2787 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablemul_integereger001.nullandnonnullablemul_integereger001
2788 {
2789     // <Title>Need to warn on build-in multiplication operator if one op is null and the other is non-nullable.</Title>
2790     // <Description>
2791     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2792     // the other is not a nullable
2793     // </Description>
2794     // <RelatedBugs></RelatedBugs>
2795     //
2796     // <Expects Status=success></Expects>
2797     //
2798     // <Code>
2799 
2800     namespace Test
2801     {
2802         public class Program
2803         {
2804             [Fact]
DynamicCSharpRunTest()2805             public static void DynamicCSharpRunTest()
2806             {
2807                 Assert.Equal(0, MainMethod());
2808             }
2809 
MainMethod()2810             public static int MainMethod()
2811             {
2812                 int rez = 0;
2813                 dynamic a = 5;
2814                 var test0 = a * null;
2815                 if (test0 == null)
2816                     rez++;
2817                 var test1 = null * a;
2818                 if (test1 == null)
2819                     rez++;
2820                 return rez == 2 ? 0 : 1;
2821             }
2822         }
2823     }
2824     // </Code>
2825 }
2826 
2827 
2828 
2829 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablemul_lng001.nullandnonnullablemul_lng001
2830 {
2831     // <Title>Need to warn on build-in multiplication operator if one op is null and the other is non-nullable.</Title>
2832     // <Description>
2833     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2834     // the other is not a nullable
2835     // </Description>
2836     // <RelatedBugs></RelatedBugs>
2837     //
2838     // <Expects Status=success></Expects>
2839     //
2840     // <Code>
2841 
2842     namespace Test
2843     {
2844         public class Program
2845         {
2846             [Fact]
DynamicCSharpRunTest()2847             public static void DynamicCSharpRunTest()
2848             {
2849                 Assert.Equal(0, MainMethod());
2850             }
2851 
MainMethod()2852             public static int MainMethod()
2853             {
2854                 int rez = 0;
2855                 dynamic a = 5L;
2856                 var test0 = a * null;
2857                 if (test0 == null)
2858                     rez++;
2859                 var test1 = null * a;
2860                 if (test1 == null)
2861                     rez++;
2862                 return rez == 2 ? 0 : 1;
2863             }
2864         }
2865     }
2866     // </Code>
2867 }
2868 
2869 
2870 
2871 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablemul_uintegereger001.nullandnonnullablemul_uintegereger001
2872 {
2873     // <Title>Need to warn on build-in multiplication operator if one op is null and the other is non-nullable.</Title>
2874     // <Description>
2875     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2876     // the other is not a nullable
2877     // </Description>
2878     // <RelatedBugs></RelatedBugs>
2879     //
2880     // <Expects Status=success></Expects>
2881     //
2882     // <Code>
2883 
2884     namespace Test
2885     {
2886         public class Program
2887         {
2888             [Fact]
DynamicCSharpRunTest()2889             public static void DynamicCSharpRunTest()
2890             {
2891                 Assert.Equal(0, MainMethod());
2892             }
2893 
MainMethod()2894             public static int MainMethod()
2895             {
2896                 int rez = 0;
2897                 dynamic a = 5U;
2898                 var test0 = a * null;
2899                 if (test0 == null)
2900                     rez++;
2901                 var test1 = null * a;
2902                 if (test1 == null)
2903                     rez++;
2904                 return rez == 2 ? 0 : 1;
2905             }
2906         }
2907     }
2908     // </Code>
2909 }
2910 
2911 
2912 
2913 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablemul_ulng001.nullandnonnullablemul_ulng001
2914 {
2915     // <Title>Need to warn on build-in multiplication operator if one op is null and the other is non-nullable.</Title>
2916     // <Description>
2917     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2918     // the other is not a nullable
2919     // </Description>
2920     // <RelatedBugs></RelatedBugs>
2921     //
2922     // <Expects Status=success></Expects>
2923     //
2924     // <Code>
2925 
2926     namespace Test
2927     {
2928         public class Program
2929         {
2930             [Fact]
DynamicCSharpRunTest()2931             public static void DynamicCSharpRunTest()
2932             {
2933                 Assert.Equal(0, MainMethod());
2934             }
2935 
MainMethod()2936             public static int MainMethod()
2937             {
2938                 int rez = 0;
2939                 dynamic a = 5UL;
2940                 var test0 = a * null;
2941                 if (test0 == null)
2942                     rez++;
2943                 var test1 = null * a;
2944                 if (test1 == null)
2945                     rez++;
2946                 return rez == 2 ? 0 : 1;
2947             }
2948         }
2949     }
2950     // </Code>
2951 }
2952 
2953 
2954 
2955 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableneq_bol001.nullandnonnullableneq_bol001
2956 {
2957     // <Title>Need to warn on build-in not equal comparison operator if one op is null and the other is non-nullable.</Title>
2958     // <Description>
2959     // We should warn whenever one of the builtin nullable operators is used and one op is null and
2960     // the other is not a nullable
2961     // </Description>
2962     // <RelatedBugs></RelatedBugs>
2963     //
2964     // <Expects Status=success></Expects>
2965     //
2966     // <Code>
2967 
2968     namespace Test
2969     {
2970         public class Program
2971         {
2972             [Fact]
DynamicCSharpRunTest()2973             public static void DynamicCSharpRunTest()
2974             {
2975                 Assert.Equal(0, MainMethod());
2976             }
2977 
MainMethod()2978             public static int MainMethod()
2979             {
2980                 int rez = 0;
2981                 dynamic a = true;
2982                 var test0 = a != null;
2983                 if (test0 == true)
2984                     rez++;
2985                 var test1 = null != a;
2986                 if (test1 == true)
2987                     rez++;
2988                 return rez == 2 ? 0 : 1;
2989             }
2990         }
2991     }
2992     // </Code>
2993 }
2994 
2995 
2996 
2997 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableneq_dcml001.nullandnonnullableneq_dcml001
2998 {
2999     // <Title>Need to warn on build-in not equal comparison operator if one op is null and the other is non-nullable.</Title>
3000     // <Description>
3001     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3002     // the other is not a nullable
3003     // </Description>
3004     // <RelatedBugs></RelatedBugs>
3005     //
3006     // <Expects Status=success></Expects>
3007     //
3008     // <Code>
3009 
3010     namespace Test
3011     {
3012         public class Program
3013         {
3014             [Fact]
DynamicCSharpRunTest()3015             public static void DynamicCSharpRunTest()
3016             {
3017                 Assert.Equal(0, MainMethod());
3018             }
3019 
MainMethod()3020             public static int MainMethod()
3021             {
3022                 int rez = 0;
3023                 dynamic a = 5M;
3024                 var test0 = a != null;
3025                 if (test0 == true)
3026                     rez++;
3027                 var test1 = null != a;
3028                 if (test1 == true)
3029                     rez++;
3030                 return rez == 2 ? 0 : 1;
3031             }
3032         }
3033     }
3034     // </Code>
3035 }
3036 
3037 
3038 
3039 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableneq_dbl001.nullandnonnullableneq_dbl001
3040 {
3041     // <Title>Need to warn on build-in not equal comparison operator if one op is null and the other is non-nullable.</Title>
3042     // <Description>
3043     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3044     // the other is not a nullable
3045     // </Description>
3046     // <RelatedBugs></RelatedBugs>
3047     //
3048     // <Expects Status=success></Expects>
3049     //
3050     // <Code>
3051 
3052     namespace Test
3053     {
3054         public class Program
3055         {
3056             [Fact]
DynamicCSharpRunTest()3057             public static void DynamicCSharpRunTest()
3058             {
3059                 Assert.Equal(0, MainMethod());
3060             }
3061 
MainMethod()3062             public static int MainMethod()
3063             {
3064                 int rez = 0;
3065                 dynamic a = 5.0D;
3066                 var test0 = a != null;
3067                 if (test0 != false)
3068                     rez++;
3069                 var test1 = null != a;
3070                 if (test1 != false)
3071                     rez++;
3072                 return rez == 2 ? 0 : 1;
3073             }
3074         }
3075     }
3076     // </Code>
3077 }
3078 
3079 
3080 
3081 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableneq_enum001.nullandnonnullableneq_enum001
3082 {
3083     // <Title>Need to warn on build-in not equal comparison operator if one op is null and the other is non-nullable.</Title>
3084     // <Description>
3085     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3086     // the other is not a nullable
3087     // </Description>
3088     // <RelatedBugs></RelatedBugs>
3089     //
3090     // <Expects Status=success></Expects>
3091     //
3092     // <Code>
3093 
3094     namespace Test
3095     {
3096         public class Program
3097         {
3098             [Fact]
DynamicCSharpRunTest()3099             public static void DynamicCSharpRunTest()
3100             {
3101                 Assert.Equal(0, MainMethod());
3102             }
3103 
MainMethod()3104             public static int MainMethod()
3105             {
3106                 int rez = 0;
3107                 dynamic a = Colors.red;
3108                 var test0 = a != null;
3109                 if (test0 == true)
3110                     rez++;
3111                 var test1 = null != a;
3112                 if (test1 == true)
3113                     rez++;
3114                 return rez == 2 ? 0 : 1;
3115             }
3116 
3117             public enum Colors
3118             {
3119                 red,
3120                 green,
3121                 blue
3122             }
3123         }
3124     }
3125     // </Code>
3126 }
3127 
3128 
3129 
3130 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableneq_flt001.nullandnonnullableneq_flt001
3131 {
3132     // <Title>Need to warn on build-in not equal comparison operator if one op is null and the other is non-nullable.</Title>
3133     // <Description>
3134     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3135     // the other is not a nullable
3136     // </Description>
3137     // <RelatedBugs></RelatedBugs>
3138     //
3139     // <Expects Status=success></Expects>
3140     //
3141     // <Code>
3142 
3143     namespace Test
3144     {
3145         public class Program
3146         {
3147             [Fact]
DynamicCSharpRunTest()3148             public static void DynamicCSharpRunTest()
3149             {
3150                 Assert.Equal(0, MainMethod());
3151             }
3152 
MainMethod()3153             public static int MainMethod()
3154             {
3155                 int rez = 0;
3156                 dynamic a = 5.0F;
3157                 var test0 = a != null;
3158                 if (test0 == false)
3159                     rez++;
3160                 var test1 = null != a;
3161                 if (test1 == false)
3162                     rez++;
3163                 return rez == 2 ? 1 : 0;
3164             }
3165         }
3166     }
3167     // </Code>
3168 }
3169 
3170 
3171 
3172 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableneq_integereger001.nullandnonnullableneq_integereger001
3173 {
3174     // <Title>Need to warn on build-in not equal comparison operator if one op is null and the other is non-nullable.</Title>
3175     // <Description>
3176     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3177     // the other is not a nullable
3178     // </Description>
3179     // <RelatedBugs></RelatedBugs>
3180     //
3181     // <Expects Status=success></Expects>
3182     //
3183     // <Code>
3184 
3185     namespace Test
3186     {
3187         public class Program
3188         {
3189             [Fact]
DynamicCSharpRunTest()3190             public static void DynamicCSharpRunTest()
3191             {
3192                 Assert.Equal(0, MainMethod());
3193             }
3194 
MainMethod()3195             public static int MainMethod()
3196             {
3197                 int rez = 0;
3198                 dynamic a = 5;
3199                 var test0 = a != null;
3200                 if (test0 == true)
3201                     rez++;
3202                 var test1 = null != a;
3203                 if (test1 == true)
3204                     rez++;
3205                 return rez == 2 ? 0 : 1;
3206             }
3207         }
3208     }
3209     // </Code>
3210 }
3211 
3212 
3213 
3214 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableneq_lng001.nullandnonnullableneq_lng001
3215 {
3216     // <Title>Need to warn on build-in not equal comparison operator if one op is null and the other is non-nullable.</Title>
3217     // <Description>
3218     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3219     // the other is not a nullable
3220     // </Description>
3221     // <RelatedBugs></RelatedBugs>
3222     //
3223     // <Expects Status=success></Expects>
3224     //
3225     // <Code>
3226 
3227     namespace Test
3228     {
3229         public class Program
3230         {
3231             [Fact]
DynamicCSharpRunTest()3232             public static void DynamicCSharpRunTest()
3233             {
3234                 Assert.Equal(0, MainMethod());
3235             }
3236 
MainMethod()3237             public static int MainMethod()
3238             {
3239                 int rez = 0;
3240                 dynamic a = 5L;
3241                 var test0 = a != null;
3242                 if (test0 == true)
3243                     rez++;
3244                 var test1 = null != a;
3245                 if (test1 == true)
3246                     rez++;
3247                 return rez == 2 ? 0 : 1;
3248             }
3249         }
3250     }
3251     // </Code>
3252 }
3253 
3254 
3255 
3256 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableneq_uintegereger001.nullandnonnullableneq_uintegereger001
3257 {
3258     // <Title>Need to warn on build-in not equal comparison operator if one op is null and the other is non-nullable.</Title>
3259     // <Description>
3260     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3261     // the other is not a nullable
3262     // </Description>
3263     // <RelatedBugs></RelatedBugs>
3264     //
3265     // <Expects Status=success></Expects>
3266     //
3267     // <Code>
3268 
3269     namespace Test
3270     {
3271         public class Program
3272         {
3273             [Fact]
DynamicCSharpRunTest()3274             public static void DynamicCSharpRunTest()
3275             {
3276                 Assert.Equal(0, MainMethod());
3277             }
3278 
MainMethod()3279             public static int MainMethod()
3280             {
3281                 int rez = 0;
3282                 dynamic a = 5U;
3283                 var test0 = a != null;
3284                 if (test0 == true)
3285                     rez++;
3286                 var test1 = null != a;
3287                 if (test1 == true)
3288                     rez++;
3289                 return rez == 2 ? 0 : 1;
3290             }
3291         }
3292     }
3293     // </Code>
3294 }
3295 
3296 
3297 
3298 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableneq_ulng001.nullandnonnullableneq_ulng001
3299 {
3300     // <Title>Need to warn on build-in not equal comparison operator if one op is null and the other is non-nullable.</Title>
3301     // <Description>
3302     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3303     // the other is not a nullable
3304     // </Description>
3305     // <RelatedBugs></RelatedBugs>
3306     //
3307     // <Expects Status=success></Expects>
3308     //
3309     // <Code>
3310 
3311     namespace Test
3312     {
3313         public class Program
3314         {
3315             [Fact]
DynamicCSharpRunTest()3316             public static void DynamicCSharpRunTest()
3317             {
3318                 Assert.Equal(0, MainMethod());
3319             }
3320 
MainMethod()3321             public static int MainMethod()
3322             {
3323                 int rez = 0;
3324                 dynamic a = 5UL;
3325                 var test0 = a != null;
3326                 if (test0 == true)
3327                     rez++;
3328                 var test1 = null != a;
3329                 if (test1 == true)
3330                     rez++;
3331                 return rez == 2 ? 0 : 1;
3332             }
3333         }
3334     }
3335     // </Code>
3336 }
3337 
3338 
3339 
3340 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableor_bol001.nullandnonnullableor_bol001
3341 {
3342     // <Title>DO NOT warn on build-in bitwise logical OR operator if one op is null and the other is non-nullable.</Title>
3343     // <Description>
3344     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3345     // the other is not a nullable
3346     // </Description>
3347     // <RelatedBugs></RelatedBugs>
3348     // <RelatedBugs></RelatedBugs>
3349     //
3350     // <Expects Status=success></Expects>
3351     // <Code>
3352     //<Expects Status=warning>\(28,26\).*CS0458</Expects>
3353     //<Expects Status=warning>\(29,30\).*CS0458</Expects>
3354 
3355     namespace Test
3356     {
3357         public class Program
3358         {
3359             [Fact]
DynamicCSharpRunTest()3360             public static void DynamicCSharpRunTest()
3361             {
3362                 Assert.Equal(0, MainMethod());
3363             }
3364 
MainMethod()3365             public static int MainMethod()
3366             {
3367                 int rez = 0;
3368                 dynamic a = false;
3369                 if ((a | null) == null)
3370                     if ((null | a) == null)
3371                         if ((false | null) == null)
3372                             if ((null | false) == null)
3373                                 return 0;
3374                 return rez == 0 ? 0 : 1;
3375             }
3376         }
3377     }
3378     // </Code>
3379 }
3380 
3381 
3382 
3383 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableor_enum001.nullandnonnullableor_enum001
3384 {
3385     // <Title>Need to warn on build-in bitwise logical OR operator if one op is null and the other is non-nullable.</Title>
3386     // <Description>
3387     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3388     // the other is not a nullable
3389     // </Description>
3390     // <RelatedBugs></RelatedBugs>
3391     //
3392     // <Expects Status=success></Expects>
3393     //
3394     // <Code>
3395 
3396     namespace Test
3397     {
3398         public class Program
3399         {
3400             [Fact]
DynamicCSharpRunTest()3401             public static void DynamicCSharpRunTest()
3402             {
3403                 Assert.Equal(0, MainMethod());
3404             }
3405 
MainMethod()3406             public static int MainMethod()
3407             {
3408                 int rez = 0;
3409                 dynamic a = Colors.red;
3410                 var test0 = a | null;
3411                 if (test0 == null)
3412                     rez++;
3413                 var test1 = null | a;
3414                 if (test1 == null)
3415                     rez++;
3416                 return rez == 2 ? 0 : 1;
3417             }
3418 
3419             public enum Colors
3420             {
3421                 red,
3422                 green,
3423                 blue
3424             }
3425         }
3426     }
3427     // </Code>
3428 }
3429 
3430 
3431 
3432 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableor_integereger001.nullandnonnullableor_integereger001
3433 {
3434     // <Title>Need to warn on build-in bitwise logical OR operator if one op is null and the other is non-nullable.</Title>
3435     // <Description>
3436     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3437     // the other is not a nullable
3438     // </Description>
3439     // <RelatedBugs></RelatedBugs>
3440     //
3441     // <Expects Status=success></Expects>
3442     //
3443     // <Code>
3444 
3445     namespace Test
3446     {
3447         public class Program
3448         {
3449             [Fact]
DynamicCSharpRunTest()3450             public static void DynamicCSharpRunTest()
3451             {
3452                 Assert.Equal(0, MainMethod());
3453             }
3454 
MainMethod()3455             public static int MainMethod()
3456             {
3457                 int rez = 0;
3458                 dynamic a = 5;
3459                 var test0 = a | null;
3460                 if (test0 == null)
3461                     rez++;
3462                 var test1 = null | a;
3463                 if (test1 == null)
3464                     rez++;
3465                 return rez == 2 ? 0 : 1;
3466             }
3467         }
3468     }
3469     // </Code>
3470 }
3471 
3472 
3473 
3474 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableor_lng001.nullandnonnullableor_lng001
3475 {
3476     // <Title>Need to warn on build-in bitwise logical OR operator if one op is null and the other is non-nullable.</Title>
3477     // <Description>
3478     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3479     // the other is not a nullable
3480     // </Description>
3481     // <RelatedBugs></RelatedBugs>
3482     //
3483     // <Expects Status=success></Expects>
3484     //
3485     // <Code>
3486 
3487     namespace Test
3488     {
3489         public class Program
3490         {
3491             [Fact]
DynamicCSharpRunTest()3492             public static void DynamicCSharpRunTest()
3493             {
3494                 Assert.Equal(0, MainMethod());
3495             }
3496 
MainMethod()3497             public static int MainMethod()
3498             {
3499                 int rez = 0;
3500                 dynamic a = 5L;
3501                 var test0 = a | null;
3502                 if (test0 == null)
3503                     rez++;
3504                 var test1 = null | a;
3505                 if (test1 == null)
3506                     rez++;
3507                 return rez == 2 ? 0 : 1;
3508             }
3509         }
3510     }
3511     // </Code>
3512 }
3513 
3514 
3515 
3516 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableor_uintegereger001.nullandnonnullableor_uintegereger001
3517 {
3518     // <Title>Need to warn on build-in bitwise logical OR operator if one op is null and the other is non-nullable.</Title>
3519     // <Description>
3520     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3521     // the other is not a nullable
3522     // </Description>
3523     // <RelatedBugs></RelatedBugs>
3524     //
3525     // <Expects Status=success></Expects>
3526     //
3527     // <Code>
3528 
3529     namespace Test
3530     {
3531         public class Program
3532         {
3533             [Fact]
DynamicCSharpRunTest()3534             public static void DynamicCSharpRunTest()
3535             {
3536                 Assert.Equal(0, MainMethod());
3537             }
3538 
MainMethod()3539             public static int MainMethod()
3540             {
3541                 int rez = 0;
3542                 dynamic a = 5U;
3543                 var test0 = a | null;
3544                 if (test0 == null)
3545                     rez++;
3546                 var test1 = null | a;
3547                 if (test1 == null)
3548                     rez++;
3549                 return rez == 2 ? 0 : 1;
3550             }
3551         }
3552     }
3553     // </Code>
3554 }
3555 
3556 
3557 
3558 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableor_ulng001.nullandnonnullableor_ulng001
3559 {
3560     // <Title>Need to warn on build-in bitwise logical OR operator if one op is null and the other is non-nullable.</Title>
3561     // <Description>
3562     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3563     // the other is not a nullable
3564     // </Description>
3565     // <RelatedBugs></RelatedBugs>
3566     //
3567     // <Expects Status=success></Expects>
3568     //
3569     // <Code>
3570 
3571     namespace Test
3572     {
3573         public class Program
3574         {
3575             [Fact]
DynamicCSharpRunTest()3576             public static void DynamicCSharpRunTest()
3577             {
3578                 Assert.Equal(0, MainMethod());
3579             }
3580 
MainMethod()3581             public static int MainMethod()
3582             {
3583                 int rez = 0;
3584                 dynamic a = 5UL;
3585                 var test0 = a | null;
3586                 if (test0 == null)
3587                     rez++;
3588                 var test1 = null | a;
3589                 if (test1 == null)
3590                     rez++;
3591                 return rez == 2 ? 0 : 1;
3592             }
3593         }
3594     }
3595     // </Code>
3596 }
3597 
3598 
3599 
3600 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablerem_dcml001.nullandnonnullablerem_dcml001
3601 {
3602     // <Title>Need to warn on build-in remainder operator if one op is null and the other is non-nullable.</Title>
3603     // <Description>
3604     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3605     // the other is not a nullable
3606     // </Description>
3607     // <RelatedBugs></RelatedBugs>
3608     //
3609     // <Expects Status=success></Expects>
3610     //
3611     // <Code>
3612 
3613     namespace Test
3614     {
3615         public class Program
3616         {
3617             [Fact]
DynamicCSharpRunTest()3618             public static void DynamicCSharpRunTest()
3619             {
3620                 Assert.Equal(0, MainMethod());
3621             }
3622 
MainMethod()3623             public static int MainMethod()
3624             {
3625                 int rez = 0;
3626                 dynamic a = 5M;
3627                 var test0 = a % null;
3628                 if (test0 == null)
3629                     rez++;
3630                 var test1 = null % a;
3631                 if (test1 == null)
3632                     rez++;
3633                 return rez == 2 ? 0 : 1;
3634             }
3635         }
3636     }
3637     // </Code>
3638 }
3639 
3640 
3641 
3642 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablerem_dbl001.nullandnonnullablerem_dbl001
3643 {
3644     // <Title>Need to warn on build-in remainder operator if one op is null and the other is non-nullable.</Title>
3645     // <Description>
3646     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3647     // the other is not a nullable
3648     // </Description>
3649     // <RelatedBugs></RelatedBugs>
3650     //
3651     // <Expects Status=success></Expects>
3652     //
3653     // <Code>
3654 
3655     namespace Test
3656     {
3657         public class Program
3658         {
3659             [Fact]
DynamicCSharpRunTest()3660             public static void DynamicCSharpRunTest()
3661             {
3662                 Assert.Equal(0, MainMethod());
3663             }
3664 
MainMethod()3665             public static int MainMethod()
3666             {
3667                 int rez = 0;
3668                 dynamic a = 5.0D;
3669                 var test0 = a % null;
3670                 if (test0 == null)
3671                     rez++;
3672                 var test1 = null % a;
3673                 if (test1 == null)
3674                     rez++;
3675                 return rez == 2 ? 0 : 1;
3676             }
3677         }
3678     }
3679     // </Code>
3680 }
3681 
3682 
3683 
3684 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablerem_flt001.nullandnonnullablerem_flt001
3685 {
3686     // <Title>Need to warn on build-in remainder operator if one op is null and the other is non-nullable.</Title>
3687     // <Description>
3688     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3689     // the other is not a nullable
3690     // </Description>
3691     // <RelatedBugs></RelatedBugs>
3692     //
3693     // <Expects Status=success></Expects>
3694     //
3695     // <Code>
3696 
3697     namespace Test
3698     {
3699         public class Program
3700         {
3701             [Fact]
DynamicCSharpRunTest()3702             public static void DynamicCSharpRunTest()
3703             {
3704                 Assert.Equal(0, MainMethod());
3705             }
3706 
MainMethod()3707             public static int MainMethod()
3708             {
3709                 int rez = 0;
3710                 dynamic a = 5.0F;
3711                 var test0 = a % null;
3712                 if (test0 == null)
3713                     rez++;
3714                 var test1 = null % a;
3715                 if (test1 == null)
3716                     rez++;
3717                 return rez == 2 ? 0 : 1;
3718             }
3719         }
3720     }
3721     // </Code>
3722 }
3723 
3724 
3725 
3726 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablerem_integereger001.nullandnonnullablerem_integereger001
3727 {
3728     // <Title>Need to warn on build-in remainder operator if one op is null and the other is non-nullable.</Title>
3729     // <Description>
3730     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3731     // the other is not a nullable
3732     // </Description>
3733     // <RelatedBugs></RelatedBugs>
3734     //
3735     // <Expects Status=success></Expects>
3736     //
3737     // <Code>
3738 
3739     namespace Test
3740     {
3741         public class Program
3742         {
3743             [Fact]
DynamicCSharpRunTest()3744             public static void DynamicCSharpRunTest()
3745             {
3746                 Assert.Equal(0, MainMethod());
3747             }
3748 
MainMethod()3749             public static int MainMethod()
3750             {
3751                 int rez = 0;
3752                 dynamic a = 5;
3753                 var test0 = a % null;
3754                 if (test0 == null)
3755                     rez++;
3756                 var test1 = null % a;
3757                 if (test1 == null)
3758                     rez++;
3759                 return rez == 2 ? 0 : 1;
3760             }
3761         }
3762     }
3763     // </Code>
3764 }
3765 
3766 
3767 
3768 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablerem_lng001.nullandnonnullablerem_lng001
3769 {
3770     // <Title>Need to warn on build-in remainder operator if one op is null and the other is non-nullable.</Title>
3771     // <Description>
3772     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3773     // the other is not a nullable
3774     // </Description>
3775     // <RelatedBugs></RelatedBugs>
3776     //
3777     // <Expects Status=success></Expects>
3778     //
3779     // <Code>
3780 
3781     namespace Test
3782     {
3783         public class Program
3784         {
3785             [Fact]
DynamicCSharpRunTest()3786             public static void DynamicCSharpRunTest()
3787             {
3788                 Assert.Equal(0, MainMethod());
3789             }
3790 
MainMethod()3791             public static int MainMethod()
3792             {
3793                 int rez = 0;
3794                 dynamic a = 5L;
3795                 var test0 = a % null;
3796                 if (test0 == null)
3797                     rez++;
3798                 var test1 = null % a;
3799                 if (test1 == null)
3800                     rez++;
3801                 return rez == 2 ? 0 : 1;
3802             }
3803         }
3804     }
3805     // </Code>
3806 }
3807 
3808 
3809 
3810 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablerem_uintegereger001.nullandnonnullablerem_uintegereger001
3811 {
3812     // <Title>Need to warn on build-in remainder operator if one op is null and the other is non-nullable.</Title>
3813     // <Description>
3814     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3815     // the other is not a nullable
3816     // </Description>
3817     // <RelatedBugs></RelatedBugs>
3818     //
3819     // <Expects Status=success></Expects>
3820     //
3821     // <Code>
3822 
3823     namespace Test
3824     {
3825         public class Program
3826         {
3827             [Fact]
DynamicCSharpRunTest()3828             public static void DynamicCSharpRunTest()
3829             {
3830                 Assert.Equal(0, MainMethod());
3831             }
3832 
MainMethod()3833             public static int MainMethod()
3834             {
3835                 int rez = 0;
3836                 dynamic a = 5;
3837                 var test0 = a % null;
3838                 if (test0 == null)
3839                     rez++;
3840                 var test1 = null % a;
3841                 if (test1 == null)
3842                     rez++;
3843                 return rez == 2 ? 0 : 1;
3844             }
3845         }
3846     }
3847     // </Code>
3848 }
3849 
3850 
3851 
3852 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablerem_ulng001.nullandnonnullablerem_ulng001
3853 {
3854     // <Title>Need to warn on build-in remainder operator if one op is null and the other is non-nullable.</Title>
3855     // <Description>
3856     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3857     // the other is not a nullable
3858     // </Description>
3859     // <RelatedBugs></RelatedBugs>
3860     //
3861     // <Expects Status=success></Expects>
3862     //
3863     // <Code>
3864 
3865     namespace Test
3866     {
3867         public class Program
3868         {
3869             [Fact]
DynamicCSharpRunTest()3870             public static void DynamicCSharpRunTest()
3871             {
3872                 Assert.Equal(0, MainMethod());
3873             }
3874 
MainMethod()3875             public static int MainMethod()
3876             {
3877                 int rez = 0;
3878                 dynamic a = 5UL;
3879                 var test0 = a % null;
3880                 if (test0 == null)
3881                     rez++;
3882                 var test1 = null % a;
3883                 if (test1 == null)
3884                     rez++;
3885                 return rez == 2 ? 0 : 1;
3886             }
3887         }
3888     }
3889     // </Code>
3890 }
3891 
3892 
3893 
3894 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableshl_integereger001.nullandnonnullableshl_integereger001
3895 {
3896     // <Title>Need to warn on build-in shift left operator if one op is null and the other is non-nullable.</Title>
3897     // <Description>
3898     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3899     // the other is not a nullable
3900     // </Description>
3901     // <RelatedBugs></RelatedBugs>
3902     //
3903     // <Expects Status=success></Expects>
3904     //
3905     // <Code>
3906 
3907     namespace Test
3908     {
3909         public class Program
3910         {
3911             [Fact]
DynamicCSharpRunTest()3912             public static void DynamicCSharpRunTest()
3913             {
3914                 Assert.Equal(0, MainMethod());
3915             }
3916 
MainMethod()3917             public static int MainMethod()
3918             {
3919                 int rez = 0;
3920                 dynamic a = 5;
3921                 var test0 = a << null;
3922                 if (test0 == null)
3923                     rez++;
3924                 var test1 = null << a;
3925                 if (test1 == null)
3926                     rez++;
3927                 return rez == 2 ? 0 : 1;
3928             }
3929         }
3930     }
3931     // </Code>
3932 }
3933 
3934 
3935 
3936 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableshl_lng001.nullandnonnullableshl_lng001
3937 {
3938     // <Title>Need to warn on build-in shift left operator if one op is null and the other is non-nullable.</Title>
3939     // <Description>
3940     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3941     // the other is not a nullable
3942     // </Description>
3943     // <RelatedBugs></RelatedBugs>
3944     //
3945     // <Expects Status=success></Expects>
3946     //
3947     //
3948     // <Code>
3949 
3950     namespace Test
3951     {
3952         public class Program
3953         {
3954             [Fact]
DynamicCSharpRunTest()3955             public static void DynamicCSharpRunTest()
3956             {
3957                 Assert.Equal(0, MainMethod());
3958             }
3959 
MainMethod()3960             public static int MainMethod()
3961             {
3962                 int rez = 0;
3963                 dynamic a = 5L;
3964                 var test0 = a << null;
3965                 if (test0 == null)
3966                     rez++;
3967                 return rez == 1 ? 0 : 1;
3968             }
3969         }
3970     }
3971     // </Code>
3972 }
3973 
3974 
3975 
3976 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableshl_uintegereger001.nullandnonnullableshl_uintegereger001
3977 {
3978     // <Title>Need to warn on build-in shift left operator if one op is null and the other is non-nullable.</Title>
3979     // <Description>
3980     // We should warn whenever one of the builtin nullable operators is used and one op is null and
3981     // the other is not a nullable
3982     // </Description>
3983     // <RelatedBugs></RelatedBugs>
3984     //
3985     // <Expects Status=success></Expects>
3986     //
3987     //
3988     // <Code>
3989 
3990     namespace Test
3991     {
3992         public class Program
3993         {
3994             [Fact]
DynamicCSharpRunTest()3995             public static void DynamicCSharpRunTest()
3996             {
3997                 Assert.Equal(0, MainMethod());
3998             }
3999 
MainMethod()4000             public static int MainMethod()
4001             {
4002                 int rez = 0;
4003                 dynamic a = 5U;
4004                 var test0 = a << null;
4005                 if (test0 == null)
4006                     rez++;
4007                 return rez == 1 ? 0 : 1;
4008             }
4009         }
4010     }
4011     // </Code>
4012 }
4013 
4014 
4015 
4016 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableshl_ulng001.nullandnonnullableshl_ulng001
4017 {
4018     // <Title>Need to warn on build-in shift left operator if one op is null and the other is non-nullable.</Title>
4019     // <Description>
4020     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4021     // the other is not a nullable
4022     // </Description>
4023     // <RelatedBugs></RelatedBugs>
4024     //
4025     // <Expects Status=success></Expects>
4026     //
4027     //
4028     // <Code>
4029 
4030     namespace Test
4031     {
4032         public class Program
4033         {
4034             [Fact]
DynamicCSharpRunTest()4035             public static void DynamicCSharpRunTest()
4036             {
4037                 Assert.Equal(0, MainMethod());
4038             }
4039 
MainMethod()4040             public static int MainMethod()
4041             {
4042                 int rez = 0;
4043                 dynamic a = 5UL;
4044                 var test0 = a << null;
4045                 if (test0 == null)
4046                     rez++;
4047                 return rez == 1 ? 0 : 1;
4048             }
4049         }
4050     }
4051     // </Code>
4052 }
4053 
4054 
4055 
4056 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableshr_integereger001.nullandnonnullableshr_integereger001
4057 {
4058     // <Title>Need to warn on build-in shift right operator if one op is null and the other is non-nullable.</Title>
4059     // <Description>
4060     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4061     // the other is not a nullable
4062     // </Description>
4063     // <RelatedBugs></RelatedBugs>
4064     //
4065     // <Expects Status=success></Expects>
4066     //
4067     // <Code>
4068 
4069     namespace Test
4070     {
4071         public class Program
4072         {
4073             [Fact]
DynamicCSharpRunTest()4074             public static void DynamicCSharpRunTest()
4075             {
4076                 Assert.Equal(0, MainMethod());
4077             }
4078 
MainMethod()4079             public static int MainMethod()
4080             {
4081                 int rez = 0;
4082                 dynamic a = 5;
4083                 var test0 = a >> null;
4084                 if (test0 == null)
4085                     rez++;
4086                 var test1 = null >> a;
4087                 if (test1 == null)
4088                     rez++;
4089                 return rez == 2 ? 0 : 1;
4090             }
4091         }
4092     }
4093     // </Code>
4094 }
4095 
4096 
4097 
4098 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableshr_lng001.nullandnonnullableshr_lng001
4099 {
4100     // <Title>Need to warn on build-in shift right operator if one op is null and the other is non-nullable.</Title>
4101     // <Description>
4102     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4103     // the other is not a nullable
4104     // </Description>
4105     // <RelatedBugs></RelatedBugs>
4106     //
4107     // <Expects Status=success></Expects>
4108     //
4109     //
4110     // <Code>
4111 
4112     namespace Test
4113     {
4114         public class Program
4115         {
4116             [Fact]
DynamicCSharpRunTest()4117             public static void DynamicCSharpRunTest()
4118             {
4119                 Assert.Equal(0, MainMethod());
4120             }
4121 
MainMethod()4122             public static int MainMethod()
4123             {
4124                 int rez = 0;
4125                 dynamic a = 5L;
4126                 var test0 = a >> null;
4127                 if (test0 == null)
4128                     rez++;
4129                 return rez == 1 ? 0 : 1;
4130             }
4131         }
4132     }
4133     // </Code>
4134 }
4135 
4136 
4137 
4138 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableshr_uintegereger001.nullandnonnullableshr_uintegereger001
4139 {
4140     // <Title>Need to warn on build-in shift right operator if one op is null and the other is non-nullable.</Title>
4141     // <Description>
4142     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4143     // the other is not a nullable
4144     // </Description>
4145     // <RelatedBugs></RelatedBugs>
4146     //
4147     // <Expects Status=success></Expects>
4148     //
4149     //
4150     // <Code>
4151 
4152     namespace Test
4153     {
4154         public class Program
4155         {
4156             [Fact]
DynamicCSharpRunTest()4157             public static void DynamicCSharpRunTest()
4158             {
4159                 Assert.Equal(0, MainMethod());
4160             }
4161 
MainMethod()4162             public static int MainMethod()
4163             {
4164                 int rez = 0;
4165                 dynamic a = 5U;
4166                 var test0 = a >> null;
4167                 if (test0 == null)
4168                     rez++;
4169                 return rez == 1 ? 0 : 1;
4170             }
4171         }
4172     }
4173     // </Code>
4174 }
4175 
4176 
4177 
4178 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullableshr_ulng001.nullandnonnullableshr_ulng001
4179 {
4180     // <Title>Need to warn on build-in shift right operator if one op is null and the other is non-nullable.</Title>
4181     // <Description>
4182     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4183     // the other is not a nullable
4184     // </Description>
4185     // <RelatedBugs></RelatedBugs>
4186     //
4187     // <Expects Status=success></Expects>
4188     //
4189     //
4190     // <Code>
4191 
4192     namespace Test
4193     {
4194         public class Program
4195         {
4196             [Fact]
DynamicCSharpRunTest()4197             public static void DynamicCSharpRunTest()
4198             {
4199                 Assert.Equal(0, MainMethod());
4200             }
4201 
MainMethod()4202             public static int MainMethod()
4203             {
4204                 int rez = 0;
4205                 dynamic a = 5UL;
4206                 var test0 = a >> null;
4207                 if (test0 == null)
4208                     rez++;
4209                 return rez == 1 ? 0 : 1;
4210             }
4211         }
4212     }
4213     // </Code>
4214 }
4215 
4216 
4217 
4218 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablesub_dcml001.nullandnonnullablesub_dcml001
4219 {
4220     // <Title>Need to warn on build-in subtraction operator if one op is null and the other is non-nullable.</Title>
4221     // <Description>
4222     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4223     // the other is not a nullable
4224     // </Description>
4225     // <RelatedBugs></RelatedBugs>
4226     //
4227     // <Expects Status=success></Expects>
4228     //
4229     // <Code>
4230 
4231     namespace Test
4232     {
4233         public class Program
4234         {
4235             [Fact]
DynamicCSharpRunTest()4236             public static void DynamicCSharpRunTest()
4237             {
4238                 Assert.Equal(0, MainMethod());
4239             }
4240 
MainMethod()4241             public static int MainMethod()
4242             {
4243                 int rez = 0;
4244                 dynamic a = 5M;
4245                 var test0 = a - null;
4246                 if (test0 == null)
4247                     rez++;
4248                 var test1 = null - a;
4249                 if (test1 == null)
4250                     rez++;
4251                 return rez == 2 ? 0 : 1;
4252             }
4253         }
4254     }
4255     // </Code>
4256 }
4257 
4258 
4259 
4260 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablesub_dbl001.nullandnonnullablesub_dbl001
4261 {
4262     // <Title>Need to warn on build-in subtraction operator if one op is null and the other is non-nullable.</Title>
4263     // <Description>
4264     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4265     // the other is not a nullable
4266     // </Description>
4267     // <RelatedBugs></RelatedBugs>
4268     //
4269     // <Expects Status=success></Expects>
4270     //
4271     // <Code>
4272 
4273     namespace Test
4274     {
4275         public class Program
4276         {
4277             [Fact]
DynamicCSharpRunTest()4278             public static void DynamicCSharpRunTest()
4279             {
4280                 Assert.Equal(0, MainMethod());
4281             }
4282 
MainMethod()4283             public static int MainMethod()
4284             {
4285                 int rez = 0;
4286                 dynamic a = 5.0D;
4287                 var test0 = a - null;
4288                 if (test0 == null)
4289                     rez++;
4290                 var test1 = null - a;
4291                 if (test1 == null)
4292                     rez++;
4293                 return rez == 2 ? 0 : 1;
4294             }
4295         }
4296     }
4297     // </Code>
4298 }
4299 
4300 
4301 
4302 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablesub_enum001.nullandnonnullablesub_enum001
4303 {
4304     // <Title>Need to warn on build-in subtraction operator if one op is null and the other is non-nullable.</Title>
4305     // <Description>
4306     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4307     // the other is not a nullable
4308     // </Description>
4309     // <RelatedBugs></RelatedBugs>
4310     //
4311     // <Expects Status=success></Expects>
4312     //
4313     // <Code>
4314 
4315     namespace Test
4316     {
4317         public class Program
4318         {
4319             [Fact]
DynamicCSharpRunTest()4320             public static void DynamicCSharpRunTest()
4321             {
4322                 Assert.Equal(0, MainMethod());
4323             }
4324 
MainMethod()4325             public static int MainMethod()
4326             {
4327                 int rez = 0;
4328                 dynamic a = Colors.red;
4329                 var test0 = a - null;
4330                 if (test0 == null)
4331                     rez++;
4332                 var test1 = null - a;
4333                 if (test1 == null)
4334                     rez++;
4335                 return rez == 2 ? 0 : 1;
4336             }
4337 
4338             public enum Colors
4339             {
4340                 red,
4341                 green,
4342                 blue
4343             }
4344         }
4345     }
4346     // </Code>
4347 }
4348 
4349 
4350 
4351 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablesub_flt001.nullandnonnullablesub_flt001
4352 {
4353     // <Title>Need to warn on build-in subtraction operator if one op is null and the other is non-nullable.</Title>
4354     // <Description>
4355     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4356     // the other is not a nullable
4357     // </Description>
4358     // <RelatedBugs></RelatedBugs>
4359     //
4360     // <Expects Status=success></Expects>
4361     //
4362     // <Code>
4363 
4364     namespace Test
4365     {
4366         public class Program
4367         {
4368             [Fact]
DynamicCSharpRunTest()4369             public static void DynamicCSharpRunTest()
4370             {
4371                 Assert.Equal(0, MainMethod());
4372             }
4373 
MainMethod()4374             public static int MainMethod()
4375             {
4376                 int rez = 0;
4377                 dynamic a = 5.0F;
4378                 var test0 = a - null;
4379                 if (test0 == null)
4380                     rez++;
4381                 var test1 = null - a;
4382                 if (test1 == null)
4383                     rez++;
4384                 return rez == 2 ? 0 : 1;
4385             }
4386         }
4387     }
4388     // </Code>
4389 }
4390 
4391 
4392 
4393 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablesub_integereger001.nullandnonnullablesub_integereger001
4394 {
4395     // <Title>Need to warn on build-in subtraction operator if one op is null and the other is non-nullable.</Title>
4396     // <Description>
4397     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4398     // the other is not a nullable
4399     // </Description>
4400     // <RelatedBugs></RelatedBugs>
4401     //
4402     // <Expects Status=success></Expects>
4403     //
4404     // <Code>
4405 
4406     namespace Test
4407     {
4408         public class Program
4409         {
4410             [Fact]
DynamicCSharpRunTest()4411             public static void DynamicCSharpRunTest()
4412             {
4413                 Assert.Equal(0, MainMethod());
4414             }
4415 
MainMethod()4416             public static int MainMethod()
4417             {
4418                 int rez = 0;
4419                 dynamic a = 5;
4420                 var test0 = a - null;
4421                 if (test0 == null)
4422                     rez++;
4423                 var test1 = null - a;
4424                 if (test1 == null)
4425                     rez++;
4426                 return rez == 2 ? 0 : 1;
4427             }
4428         }
4429     }
4430     // </Code>
4431 }
4432 
4433 
4434 
4435 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablesub_lng001.nullandnonnullablesub_lng001
4436 {
4437     // <Title>Need to warn on build-in subtraction operator if one op is null and the other is non-nullable.</Title>
4438     // <Description>
4439     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4440     // the other is not a nullable
4441     // </Description>
4442     // <RelatedBugs></RelatedBugs>
4443     //
4444     // <Expects Status=success></Expects>
4445     //
4446     // <Code>
4447 
4448     namespace Test
4449     {
4450         public class Program
4451         {
4452             [Fact]
DynamicCSharpRunTest()4453             public static void DynamicCSharpRunTest()
4454             {
4455                 Assert.Equal(0, MainMethod());
4456             }
4457 
MainMethod()4458             public static int MainMethod()
4459             {
4460                 int rez = 0;
4461                 dynamic a = 5L;
4462                 var test0 = a - null;
4463                 if (test0 == null)
4464                     rez++;
4465                 var test1 = null - a;
4466                 if (test1 == null)
4467                     rez++;
4468                 return rez == 2 ? 0 : 1;
4469             }
4470         }
4471     }
4472     // </Code>
4473 }
4474 
4475 
4476 
4477 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablesub_uintegereger001.nullandnonnullablesub_uintegereger001
4478 {
4479     // <Title>Need to warn on build-in subtraction operator if one op is null and the other is non-nullable.</Title>
4480     // <Description>
4481     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4482     // the other is not a nullable
4483     // </Description>
4484     // <RelatedBugs></RelatedBugs>
4485     //
4486     // <Expects Status=success></Expects>
4487     //
4488     // <Code>
4489 
4490     namespace Test
4491     {
4492         public class Program
4493         {
4494             [Fact]
DynamicCSharpRunTest()4495             public static void DynamicCSharpRunTest()
4496             {
4497                 Assert.Equal(0, MainMethod());
4498             }
4499 
MainMethod()4500             public static int MainMethod()
4501             {
4502                 int rez = 0;
4503                 dynamic a = 5U;
4504                 var test0 = a - null;
4505                 if (test0 == null)
4506                     rez++;
4507                 var test1 = null - a;
4508                 if (test1 == null)
4509                     rez++;
4510                 return rez == 2 ? 0 : 1;
4511             }
4512         }
4513     }
4514     // </Code>
4515 }
4516 
4517 
4518 
4519 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablesub_ulng001.nullandnonnullablesub_ulng001
4520 {
4521     // <Title>Need to warn on build-in subtraction operator if one op is null and the other is non-nullable.</Title>
4522     // <Description>
4523     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4524     // the other is not a nullable
4525     // </Description>
4526     // <RelatedBugs></RelatedBugs>
4527     //
4528     // <Expects Status=success></Expects>
4529     //
4530     // <Code>
4531 
4532     namespace Test
4533     {
4534         public class Program
4535         {
4536             [Fact]
DynamicCSharpRunTest()4537             public static void DynamicCSharpRunTest()
4538             {
4539                 Assert.Equal(0, MainMethod());
4540             }
4541 
MainMethod()4542             public static int MainMethod()
4543             {
4544                 int rez = 0;
4545                 dynamic a = 5UL;
4546                 var test0 = a - null;
4547                 if (test0 == null)
4548                     rez++;
4549                 var test1 = null - a;
4550                 if (test1 == null)
4551                     rez++;
4552                 return rez == 2 ? 0 : 1;
4553             }
4554         }
4555     }
4556     // </Code>
4557 }
4558 
4559 
4560 
4561 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablexor_bol001.nullandnonnullablexor_bol001
4562 {
4563     // <Title>Need to warn on build-in bitwise logical exclusive OR operator if one op is null and the other is non-nullable.</Title>
4564     // <Description>
4565     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4566     // the other is not a nullable
4567     // </Description>
4568     // <RelatedBugs></RelatedBugs>
4569     //
4570     // <Expects Status=success></Expects>
4571     //
4572     // <Code>
4573 
4574     namespace Test
4575     {
4576         public class Program
4577         {
4578             [Fact]
DynamicCSharpRunTest()4579             public static void DynamicCSharpRunTest()
4580             {
4581                 Assert.Equal(0, MainMethod());
4582             }
4583 
MainMethod()4584             public static int MainMethod()
4585             {
4586                 int rez = 0;
4587                 dynamic a = true;
4588                 var test0 = a ^ null;
4589                 if (test0 == null)
4590                     rez++;
4591                 var test1 = null ^ a;
4592                 if (test1 == null)
4593                     rez++;
4594                 return rez == 2 ? 0 : 1;
4595             }
4596         }
4597     }
4598     // </Code>
4599 }
4600 
4601 
4602 
4603 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablexor_enum001.nullandnonnullablexor_enum001
4604 {
4605     // <Title>Need to warn on build-in bitwise logical exclusive OR operator if one op is null and the other is non-nullable.</Title>
4606     // <Description>
4607     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4608     // the other is not a nullable
4609     // </Description>
4610     // <RelatedBugs></RelatedBugs>
4611     //
4612     // <Expects Status=success></Expects>
4613     //
4614     // <Code>
4615 
4616     namespace Test
4617     {
4618         public class Program
4619         {
4620             [Fact]
DynamicCSharpRunTest()4621             public static void DynamicCSharpRunTest()
4622             {
4623                 Assert.Equal(0, MainMethod());
4624             }
4625 
MainMethod()4626             public static int MainMethod()
4627             {
4628                 int rez = 0;
4629                 dynamic a = (ulong)Colors.red;
4630                 var test0 = a ^ null;
4631                 if (test0 == null)
4632                     rez++;
4633                 var test1 = null ^ a;
4634                 if (test1 == null)
4635                     rez++;
4636                 return rez == 2 ? 0 : 1;
4637             }
4638 
4639             public enum Colors
4640             {
4641                 red,
4642                 green,
4643                 blue
4644             }
4645         }
4646     }
4647     // </Code>
4648 }
4649 
4650 
4651 
4652 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablexor_integereger001.nullandnonnullablexor_integereger001
4653 {
4654     // <Title>Need to warn on build-in bitwise logical exclusive OR operator if one op is null and the other is non-nullable.</Title>
4655     // <Description>
4656     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4657     // the other is not a nullable
4658     // </Description>
4659     // <RelatedBugs></RelatedBugs>
4660     //
4661     // <Expects Status=success></Expects>
4662     //
4663     // <Code>
4664 
4665     namespace Test
4666     {
4667         public class Program
4668         {
4669             [Fact]
DynamicCSharpRunTest()4670             public static void DynamicCSharpRunTest()
4671             {
4672                 Assert.Equal(0, MainMethod());
4673             }
4674 
MainMethod()4675             public static int MainMethod()
4676             {
4677                 int rez = 0;
4678                 dynamic a = 5;
4679                 var test0 = a ^ null;
4680                 if (test0 == null)
4681                     rez++;
4682                 var test1 = null ^ a;
4683                 if (test1 == null)
4684                     rez++;
4685                 return rez == 2 ? 0 : 1;
4686             }
4687         }
4688     }
4689     // </Code>
4690 }
4691 
4692 
4693 
4694 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablexor_lng001.nullandnonnullablexor_lng001
4695 {
4696     // <Title>Need to warn on build-in bitwise logical exclusive OR operator if one op is null and the other is non-nullable.</Title>
4697     // <Description>
4698     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4699     // the other is not a nullable
4700     // </Description>
4701     // <RelatedBugs></RelatedBugs>
4702     //
4703     // <Expects Status=success></Expects>
4704     //
4705     // <Code>
4706 
4707     namespace Test
4708     {
4709         public class Program
4710         {
4711             [Fact]
DynamicCSharpRunTest()4712             public static void DynamicCSharpRunTest()
4713             {
4714                 Assert.Equal(0, MainMethod());
4715             }
4716 
MainMethod()4717             public static int MainMethod()
4718             {
4719                 int rez = 0;
4720                 dynamic a = 5L;
4721                 var test0 = a ^ null;
4722                 if (test0 == null)
4723                     rez++;
4724                 var test1 = null ^ a;
4725                 if (test1 == null)
4726                     rez++;
4727                 return rez == 2 ? 0 : 1;
4728             }
4729         }
4730     }
4731     // </Code>
4732 }
4733 
4734 
4735 
4736 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablexor_uintegereger001.nullandnonnullablexor_uintegereger001
4737 {
4738     // <Title>Need to warn on build-in bitwise logical exclusive OR operator if one op is null and the other is non-nullable.</Title>
4739     // <Description>
4740     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4741     // the other is not a nullable
4742     // </Description>
4743     // <RelatedBugs></RelatedBugs>
4744     //
4745     // <Expects Status=success></Expects>
4746     //
4747     // <Code>
4748 
4749     namespace Test
4750     {
4751         public class Program
4752         {
4753             [Fact]
DynamicCSharpRunTest()4754             public static void DynamicCSharpRunTest()
4755             {
4756                 Assert.Equal(0, MainMethod());
4757             }
4758 
MainMethod()4759             public static int MainMethod()
4760             {
4761                 int rez = 0;
4762                 dynamic a = 5U;
4763                 var test0 = a ^ null;
4764                 if (test0 == null)
4765                     rez++;
4766                 var test1 = null ^ a;
4767                 if (test1 == null)
4768                     rez++;
4769                 return rez == 2 ? 0 : 1;
4770             }
4771         }
4772     }
4773     // </Code>
4774 }
4775 
4776 
4777 
4778 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullandnonnullablexor_ulng001.nullandnonnullablexor_ulng001
4779 {
4780     // <Title>Need to warn on build-in bitwise logical exclusive OR operator if one op is null and the other is non-nullable.</Title>
4781     // <Description>
4782     // We should warn whenever one of the builtin nullable operators is used and one op is null and
4783     // the other is not a nullable
4784     // </Description>
4785     // <RelatedBugs></RelatedBugs>
4786     //
4787     // <Expects Status=success></Expects>
4788     //
4789     // <Code>
4790 
4791     namespace Test
4792     {
4793         public class Program
4794         {
4795             [Fact]
DynamicCSharpRunTest()4796             public static void DynamicCSharpRunTest()
4797             {
4798                 Assert.Equal(0, MainMethod());
4799             }
4800 
MainMethod()4801             public static int MainMethod()
4802             {
4803                 int rez = 0;
4804                 dynamic a = 5UL;
4805                 var test0 = a ^ null;
4806                 if (test0 == null)
4807                     rez++;
4808                 var test1 = null ^ a;
4809                 if (test1 == null)
4810                     rez++;
4811                 return rez == 2 ? 0 : 1;
4812             }
4813         }
4814     }
4815     // </Code>
4816 }
4817 
4818 
4819 
4820 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.verify.verify
4821 {
4822     public class Verify
4823     {
Check(dynamic actual, dynamic expected)4824         public static int Check(dynamic actual, dynamic expected)
4825         {
4826             int index = 0;
4827             foreach (var item in expected)
4828             {
4829                 if (actual[index] != expected[index])
4830                     return 0;
4831                 index++;
4832             }
4833 
4834             return 0;
4835         }
4836     }
4837 }
4838 
4839 
4840 
4841 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullcoalescing004.nullcoalescing004
4842 {
4843     // <Title>dynamic and nullable</Title>
4844     // <Description>
4845     // null-coalescing operator
4846     // </Description>
4847     // <RelatedBugs></RelatedBugs>
4848     // <Expects Status=success></Expects>
4849     //
4850     // <Code>
4851 
4852     public enum E
4853     {
4854         One = 1,
4855         Two = 2
4856     }
4857 
4858     public struct S
4859     {
4860     }
4861 
4862     namespace Test
4863     {
4864         public class Program
4865         {
4866             [Fact]
DynamicCSharpRunTest()4867             public static void DynamicCSharpRunTest()
4868             {
4869                 Assert.Equal(0, MainMethod());
4870             }
4871 
MainMethod()4872             public static int MainMethod()
4873             {
4874                 E? x = E.One, y = null;
4875                 dynamic d1 = new S();
4876                 dynamic d2 = null;
4877                 dynamic[] result = new dynamic[4];
4878                 dynamic[] expected = new dynamic[]
4879                 {
4880                 E.One, null, new S(), new S()}
4881 
4882                 ;
4883                 result[0] = x ?? d1;
4884                 result[1] = y ?? d2;
4885                 result[2] = d1 ?? x;
4886                 result[3] = d1 ?? y;
4887                 if (result[0] == expected[0] && result[1] == expected[1] && result[2].GetType() == expected[2].GetType() && result[3].GetType() == expected[3].GetType())
4888                     return 0;
4889                 return 1;
4890             }
4891         }
4892     }
4893     // </Code>
4894 }
4895 
4896 
4897 
4898 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.nullcoalescing005.nullcoalescing005
4899 {
4900     // <Title>dynamic and nullable</Title>
4901     // <Description>
4902     // null-coalescing operator
4903     // </Description>
4904     // <RelatedBugs></RelatedBugs>
4905     // <Expects Status=success></Expects>
4906     //
4907     // <Code>
4908 
4909     public enum E
4910     {
4911         One = 1,
4912         Two = 2
4913     }
4914 
4915     public struct S
4916     {
4917     }
4918 
4919     namespace Test
4920     {
4921         public class Program
4922         {
4923             [Fact]
DynamicCSharpRunTest()4924             public static void DynamicCSharpRunTest()
4925             {
4926                 Assert.Equal(0, MainMethod());
4927             }
4928 
MainMethod()4929             public static int MainMethod()
4930             {
4931                 S? x = new S(), y = null;
4932                 dynamic d1 = E.One;
4933                 dynamic d2 = null;
4934                 dynamic[] result = new dynamic[4];
4935                 dynamic[] expected = new dynamic[]
4936                 {
4937                 new S(), null, E.One, E.One
4938                 }
4939 
4940                 ;
4941                 result[0] = x ?? d1;
4942                 result[1] = y ?? d2;
4943                 result[2] = d1 ?? x;
4944                 result[3] = d1 ?? y;
4945                 if (result[0].GetType() == expected[0].GetType() && result[1] == expected[1] && result[2] == expected[2] && result[3] == expected[3])
4946                     return 0;
4947                 return 1;
4948             }
4949         }
4950     }
4951     // </Code>
4952 }
4953 
4954 
4955 
4956 namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.conversion001.conversion001
4957 {
4958     using ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.nullable.verify.verify;
4959     // <Title>dynamic and nullable</Title>
4960     // <Description>
4961     // conversion
4962     // </Description>
4963     // <RelatedBugs></RelatedBugs>
4964     // <Expects Status=success></Expects>
4965     //
4966     // <Code>
4967 
4968     namespace Test
4969     {
4970         public class Program
4971         {
4972             [Fact]
DynamicCSharpRunTest()4973             public static void DynamicCSharpRunTest()
4974             {
4975                 Assert.Equal(0, MainMethod());
4976             }
4977 
MainMethod()4978             public static int MainMethod()
4979             {
4980                 dynamic d1 = null;
4981                 dynamic d2 = default(dynamic);
4982                 int? i1 = d1, i2 = d2;
4983                 char? c1 = d1, c2 = d2;
4984                 decimal? m1 = d1, m2 = d2;
4985                 E? e1 = d1, e2 = d2;
4986                 S? s1 = d1, s2 = d2;
4987                 dynamic result = new dynamic[]
4988                 {
4989                 i1, i2, c1, c2, m1, m2, e1, e2, s1, s2
4990                 }
4991 
4992                 ;
4993                 dynamic expected = new dynamic[]
4994                 {
4995                 null, null, null, null, null, null, null, null, null, null
4996                 }
4997 
4998                 ;
4999                 return Verify.Check(result, expected);
5000             }
5001         }
5002 
5003         public enum E
5004         {
5005         }
5006 
5007         public struct S
5008         {
5009         }
5010     }
5011     // </Code>
5012 }
5013