Skip to content

Commit 41382dd

Browse files
committed
C#: A regression test for extractor crash when wrong expression type is used for a literal.
1 parent 04bccd0 commit 41382dd

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

csharp/ql/test/library-tests/regressions/Program.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,16 @@ int Test()
8181
return 0;
8282
}
8383
}
84+
85+
class LiteralConversions
86+
{
87+
struct Point
88+
{
89+
public int? x, y;
90+
}
91+
92+
void F()
93+
{
94+
new Point { x=1, y=2 };
95+
}
96+
}

csharp/ql/test/library-tests/regressions/TypeMentions.expected

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,9 @@
3939
| Program.cs:69:5:69:8 | Boolean |
4040
| Program.cs:69:16:69:18 | Int32 |
4141
| Program.cs:75:5:75:7 | Int32 |
42+
| Program.cs:89:16:89:18 | Int32 |
43+
| Program.cs:89:16:89:18 | Int32 |
44+
| Program.cs:89:16:89:19 | Nullable<Int32> |
45+
| Program.cs:89:16:89:19 | Nullable<Int32> |
46+
| Program.cs:92:5:92:8 | Void |
47+
| Program.cs:94:13:94:17 | Point |

0 commit comments

Comments
 (0)