diff --git a/test/WebSites/Basic/Controllers/Issue3013Controller.cs b/test/WebSites/Basic/Controllers/Issue3013Controller.cs new file mode 100644 index 0000000000..ab6cbe7aab --- /dev/null +++ b/test/WebSites/Basic/Controllers/Issue3013Controller.cs @@ -0,0 +1,26 @@ +#if NET6_0_OR_GREATER +using Microsoft.AspNetCore.Mvc; + +namespace Basic.Controllers; + +[ApiController] +[Route("[controller]/[action]")] +public class Issue3013Controller : ControllerBase +{ + [HttpGet] + public TestResponse Get() + { + return new() + { + Foo = new(1, 2), + }; + } + + public record TestResponse + { + public TestStruct? Foo { get; init; } + } + + public record struct TestStruct(int A, int B); +} +#endif