Skip to content

Commit 302bf4f

Browse files
committed
C#: Add ref struct boxing example (false positive).
1 parent b26c342 commit 302bf4f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

csharp/ql/test/library-tests/conversion/boxing/Boxing.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,6 @@ void M()
4545
x1 = x15; // not a boxing conversion
4646
}
4747
}
48+
49+
// Ref structs can't be converted to a dynamic, object or valuetype.
50+
ref struct S { }

csharp/ql/test/library-tests/conversion/boxing/Boxing.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@
117117
| Nullable<Int32> | Object |
118118
| Nullable<Int32> | ValueType |
119119
| Nullable<Int32> | dynamic |
120+
| S | Object |
121+
| S | ValueType |
122+
| S | dynamic |
120123
| T1 | Object |
121124
| T1 | dynamic |
122125
| T3 | Object |

0 commit comments

Comments
 (0)