mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
C#: Add some example struct types, including one with a default constructor declarations.
This commit is contained in:
19
csharp/ql/test/library-tests/csharp10/StructTypes.cs
Normal file
19
csharp/ql/test/library-tests/csharp10/StructTypes.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
// Struct with user declared parameterless constructor.
|
||||
public struct MyStructParameterlessConstructor
|
||||
{
|
||||
public int X;
|
||||
public readonly int Y;
|
||||
public int Z { get; }
|
||||
|
||||
public MyStructParameterlessConstructor()
|
||||
{
|
||||
X = 1;
|
||||
Y = 2;
|
||||
Z = 3;
|
||||
}
|
||||
}
|
||||
|
||||
// Struct with compiler generated parameterless constructor.
|
||||
public struct MyDefaultStruct { }
|
||||
Reference in New Issue
Block a user