From 41382dd7321738f6dd145bbe3c963cf7f5966fe5 Mon Sep 17 00:00:00 2001 From: calum Date: Thu, 23 Aug 2018 17:27:14 +0100 Subject: [PATCH] C#: A regression test for extractor crash when wrong expression type is used for a literal. --- csharp/ql/test/library-tests/regressions/Program.cs | 13 +++++++++++++ .../library-tests/regressions/TypeMentions.expected | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/csharp/ql/test/library-tests/regressions/Program.cs b/csharp/ql/test/library-tests/regressions/Program.cs index 88f57263a30c..1f57d594c1f2 100644 --- a/csharp/ql/test/library-tests/regressions/Program.cs +++ b/csharp/ql/test/library-tests/regressions/Program.cs @@ -81,3 +81,16 @@ int Test() return 0; } } + +class LiteralConversions +{ + struct Point + { + public int? x, y; + } + + void F() + { + new Point { x=1, y=2 }; + } +} diff --git a/csharp/ql/test/library-tests/regressions/TypeMentions.expected b/csharp/ql/test/library-tests/regressions/TypeMentions.expected index 76bb248e4885..5f8f647903de 100644 --- a/csharp/ql/test/library-tests/regressions/TypeMentions.expected +++ b/csharp/ql/test/library-tests/regressions/TypeMentions.expected @@ -39,3 +39,9 @@ | Program.cs:69:5:69:8 | Boolean | | Program.cs:69:16:69:18 | Int32 | | Program.cs:75:5:75:7 | Int32 | +| Program.cs:89:16:89:18 | Int32 | +| Program.cs:89:16:89:18 | Int32 | +| Program.cs:89:16:89:19 | Nullable | +| Program.cs:89:16:89:19 | Nullable | +| Program.cs:92:5:92:8 | Void | +| Program.cs:94:13:94:17 | Point |