File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
csharp/ql/test/query-tests/Language Abuse/UselessCastToSelf Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -18,4 +18,13 @@ void f()
1818 var good6 = ( Action < int > ) ( delegate ( int x ) { } ) ;
1919 var good7 = ( Action < int > ) ( ( int x ) => { } ) ;
2020 }
21+
22+ enum Enum
23+ {
24+ A = 2 ,
25+ B = 1 | A ,
26+ C = 1 | ( int ) A , // BAD
27+ D = 9 | ( 32 << A ) ,
28+ E = 9 | ( 32 << ( int ) A ) // BAD
29+ }
2130}
Original file line number Diff line number Diff line change 11| UselessCastToSelf.cs:8:20:8:25 | (...) ... | This cast is redundant because the expression already has type Int32. |
22| UselessCastToSelf.cs:9:20:9:29 | (...) ... | This cast is redundant because the expression already has type Test. |
33| UselessCastToSelf.cs:10:20:10:31 | ... as ... | This cast is redundant because the expression already has type Test. |
4+ | UselessCastToSelf.cs:26:17:26:22 | (...) ... | This cast is redundant because the expression already has type Int32. |
5+ | UselessCastToSelf.cs:28:24:28:29 | (...) ... | This cast is redundant because the expression already has type Int32. |
You can’t perform that action at this time.
0 commit comments