diff --git a/tests/ComputeSharp.Tests.SourceGenerators/AnalyzerTests.cs b/tests/ComputeSharp.Tests.SourceGenerators/AnalyzerTests.cs index 6861d648..ec84415e 100644 --- a/tests/ComputeSharp.Tests.SourceGenerators/AnalyzerTests.cs +++ b/tests/ComputeSharp.Tests.SourceGenerators/AnalyzerTests.cs @@ -10,7 +10,7 @@ namespace ComputeSharp.Tests.SourceGenerators; public class AnalyzerTests { [TestMethod] - public async Task InvalidShaderField() + public async Task NotAccessibleNestedShaderType() { const string source = """ using ComputeSharp; @@ -33,4 +33,35 @@ public class AnalyzerTests await CSharpAnalyzerWithLanguageVersionTest.VerifyAnalyzerAsync(source); } + + [TestMethod] + public async Task NotAccessibleShaderFieldType() + { + const string source = """ + using ComputeSharp; + + namespace MyFancyApp.Sample; + + public partial class Foo + { + [{|CMPS0056:GeneratedComputeShaderDescriptor|}] + private partial struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + public Bar bar; + + public void Execute() + { + } + } + + private struct Bar + { + public int X; + } + } + """; + + await CSharpAnalyzerWithLanguageVersionTest.VerifyAnalyzerAsync(source); + } } \ No newline at end of file