templating
templating copied to clipboard
Should RunSpec._overrides be nullable
https://github.com/dotnet/templating/blob/main/src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/RunSpec.cs
internal class RunSpec : IRunSpec
{
private readonly IReadOnlyList<IOperationProvider> _overrides;
internal RunSpec(IReadOnlyList<IOperationProvider> operationOverrides, string? variableFormatString)
{
_overrides = operationOverrides;
VariableFormatString = variableFormatString ?? "{0}";
}
public string VariableFormatString { get; }
public bool TryGetTargetRelPath(string sourceRelPath, out string? targetRelPath)
{
targetRelPath = null;
return false;
}
public IReadOnlyList<IOperationProvider> GetOperations(IReadOnlyList<IOperationProvider> sourceOperations)
{
return _overrides ?? sourceOperations;
}
}
since _overrides the ?? sourceOperations part of GetOperations should never be executed.
What am i missing here?