Diagnostics:
// Rocks\Rocks.RockGenerator\ParamMethods_Rock_Create.g.cs(18,84): error CS0246: The type or namespace name 'scoped' could not be found (are you missing a using directive or an assembly reference?)
DiagnosticResult.CompilerError("CS0246").WithSpan("Rocks\Rocks.RockGenerator\ParamMethods_Rock_Create.g.cs", 18, 84, 18, 90).WithArguments("scoped"),
// Rocks\Rocks.RockGenerator\ParamMethods_Rock_Create.g.cs(18,91): error CS1001: Identifier expected
DiagnosticResult.CompilerError("CS1001").WithSpan("Rocks\Rocks.RockGenerator\ParamMethods_Rock_Create.g.cs", 18, 91, 18, 97),
// Rocks\Rocks.RockGenerator\ParamMethods_Rock_Create.g.cs(18,91): error CS1003: Syntax error, ',' expected
DiagnosticResult.CompilerError("CS1003").WithSpan("Rocks\Rocks.RockGenerator\ParamMethods_Rock_Create.g.cs", 18, 91, 18, 97).WithArguments(","),
// Rocks\Rocks.RockGenerator\ParamMethods_Rock_Create.g.cs(187,31): error CS0246: The type or namespace name 'scoped' could not be found (are you missing a using directive or an assembly reference?)
DiagnosticResult.CompilerError("CS0246").WithSpan("Rocks\Rocks.RockGenerator\ParamMethods_Rock_Create.g.cs", 187, 31, 187, 37).WithArguments("scoped"),
// Rocks\Rocks.RockGenerator\ParamMethods_Rock_Create.g.cs(187,38): error CS1001: Identifier expected
DiagnosticResult.CompilerError("CS1001").WithSpan("Rocks\Rocks.RockGenerator\ParamMethods_Rock_Create.g.cs", 187, 38, 187, 44),
// Rocks\Rocks.RockGenerator\ParamMethods_Rock_Create.g.cs(187,38): error CS1003: Syntax error, ',' expected
DiagnosticResult.CompilerError("CS1003").WithSpan("Rocks\Rocks.RockGenerator\ParamMethods_Rock_Create.g.cs", 187, 38, 187, 44).WithArguments(","),
// Rocks\Rocks.RockGenerator\ParamMethods_Rock_Create.g.cs(199,33): error CS1503: Argument 1: cannot convert from 'System.ReadOnlySpan<string>' to 'scoped'
DiagnosticResult.CompilerError("CS1503").WithSpan("Rocks\Rocks.RockGenerator\ParamMethods_Rock_Create.g.cs", 199, 33, 199, 38).WithArguments("1", "System.ReadOnlySpan<string>", "scoped"),
// Rocks\Rocks.RockGenerator\ParamMethods_Rock_Make.g.cs(40,31): error CS0246: The type or namespace name 'scoped' could not be found (are you missing a using directive or an assembly reference?)
DiagnosticResult.CompilerError("CS0246").WithSpan("Rocks\Rocks.RockGenerator\ParamMethods_Rock_Make.g.cs", 40, 31, 40, 37).WithArguments("scoped"),
// Rocks\Rocks.RockGenerator\ParamMethods_Rock_Make.g.cs(40,38): error CS1001: Identifier expected
DiagnosticResult.CompilerError("CS1001").WithSpan("Rocks\Rocks.RockGenerator\ParamMethods_Rock_Make.g.cs", 40, 38, 40, 44),
// Rocks\Rocks.RockGenerator\ParamMethods_Rock_Make.g.cs(40,38): error CS1003: Syntax error, ',' expected
DiagnosticResult.CompilerError("CS1003").WithSpan("Rocks\Rocks.RockGenerator\ParamMethods_Rock_Make.g.cs", 40, 38, 40, 44).WithArguments(","),
To Reproduce
Run this in the test project:
Expected behavior
Mock code is built and compiles.
Actual behavior
Errors occur:
Additional context
What's happening is that
paramshave been updated in C# 13 that you can use things likeReadOnlySpan<>. Right now, Rocks thinks it needs to addscopedto the parameter inDoSpan(), but that should not be done if it's aparams.This was found on many types,
System.IO.StreamWriterbeing one of them.