diff --git a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AZC0015Tests.cs b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AZC0015Tests.cs index b8f821ee9e0..462a30629f1 100644 --- a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AZC0015Tests.cs +++ b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AZC0015Tests.cs @@ -44,6 +44,8 @@ await Verifier.CreateAnalyzer(code) [InlineData("public Response ClientMethodAsync() { return default; }")] [InlineData("public Response ClientMethodAsync() { return default; }")] [InlineData("public Task> ClientMethodAsync() { return default; }")] + [InlineData("public NullableResponse ClientMethodAsync() { return default; }")] + [InlineData("public Task> ClientMethodAsync() { return default; }")] [InlineData("public Response ClientMethodAsync() { return default; }")] [InlineData("public SomeClient ClientMethod() { return default; }")] public async Task AZC0015NotProducedForValidReturnTypes(string usage) @@ -65,4 +67,4 @@ await Verifier.CreateAnalyzer(code) .RunAsync(); } } -} \ No newline at end of file +} diff --git a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AzureAnalyzerTest.cs b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AzureAnalyzerTest.cs index dae8708ac76..309336bc00e 100644 --- a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AzureAnalyzerTest.cs +++ b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AzureAnalyzerTest.cs @@ -16,7 +16,7 @@ namespace Azure.ClientSdk.Analyzers.Tests { private static readonly ReferenceAssemblies DefaultReferenceAssemblies = ReferenceAssemblies.Default.AddPackages(ImmutableArray.Create( - new PackageIdentity("Azure.Core", "1.21.0"), + new PackageIdentity("Azure.Core", "1.26.0"), new PackageIdentity("Microsoft.Bcl.AsyncInterfaces", "1.1.0"), new PackageIdentity("System.Text.Json", "4.6.0"), new PackageIdentity("Newtonsoft.Json", "12.0.3"), diff --git a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AzureAnalyzerVerifier.cs b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AzureAnalyzerVerifier.cs index 60a54059dbc..12a8d8e858d 100644 --- a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AzureAnalyzerVerifier.cs +++ b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AzureAnalyzerVerifier.cs @@ -17,7 +17,7 @@ namespace Azure.ClientSdk.Analyzers.Tests { private static readonly ReferenceAssemblies DefaultReferenceAssemblies = ReferenceAssemblies.Default.AddPackages(ImmutableArray.Create( - new PackageIdentity("Azure.Core", "1.21.0"), + new PackageIdentity("Azure.Core", "1.26.0"), new PackageIdentity("Microsoft.Bcl.AsyncInterfaces", "1.1.0"), new PackageIdentity("System.Text.Json", "4.6.0"), new PackageIdentity("Newtonsoft.Json", "12.0.3"), diff --git a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/ClientMethodsAnalyzer.cs b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/ClientMethodsAnalyzer.cs index c24ff2ebf7c..ab20919b072 100644 --- a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/ClientMethodsAnalyzer.cs +++ b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/ClientMethodsAnalyzer.cs @@ -27,7 +27,7 @@ static bool SupportsCancellationsParameter(IParameterSymbol parameterSymbol) { return (parameterSymbol.Name == "cancellationToken" && parameterSymbol.Type.Name == "CancellationToken") || (parameterSymbol.Name == "context" && parameterSymbol.Type.Name == "RequestContext"); - } + } CheckClientMethodReturnType(context, member); @@ -100,6 +100,7 @@ bool IsOrImplements(ITypeSymbol typeSymbol, string typeName) } if (IsOrImplements(unwrappedType, "Response") || + IsOrImplements(unwrappedType, "NullableResponse") || IsOrImplements(unwrappedType, "Operation") || IsOrImplements(originalType, "Pageable") || IsOrImplements(originalType, "AsyncPageable") ||