Describe the bug
When a method has a default argument that uses [AllowNull], Rocks passes that into an Argument, which causes a CS8604 error
To Reproduce
var code =
"""
using Rocks;
using System.Diagnostics.CodeAnalysis;
#nullable enable
public interface IGraphType { }
public class ConnectionBuilder<TSourceType>
{
public virtual ConnectionBuilder<TSourceType> Argument<TArgumentGraphType, TArgumentType>(string name, string? description,
[AllowNull] TArgumentType defaultValue = default!)
where TArgumentGraphType : IGraphType => new();
}
public static class Test
{
public static void Go() => Rock.Create<ConnectionBuilder<object>>();
}
""";
Expected behavior
The mock is created with no issues.
Additional context
This was found on GraphQL.Builders.ConnectionBuilder<>
Describe the bug
When a method has a default argument that uses
[AllowNull], Rocks passes that into anArgument, which causes aCS8604errorTo Reproduce
Expected behavior
The mock is created with no issues.
Additional context
This was found on
GraphQL.Builders.ConnectionBuilder<>