fix default value arrays source generation

this change doesn't actually do anything since we don't even have arrays in default values
This commit is contained in:
CasualPokePlayer 2023-10-25 22:55:46 -07:00
parent f2a4794105
commit 00e0a5fb2a
2 changed files with 2 additions and 2 deletions

View File

@ -58,9 +58,9 @@ public class DefaultSetterGenerator : ISourceGenerator
// this single arg is just the value assigned to the default value
var arg = ctorArgs.Value[0];
// a bit lame, but it'll work
// TODO: do we even want to handle arrays? do we even have any arrays in default values???
// TODO: do we even want to handle arrays? we don't even have arrays in default values...
var converionStr = arg.Kind == TypedConstantKind.Array
? $"new {arg.Type} " // new T[]
? $"new {arg.Type}[] " // new T[]
: ""; // do we need a cast (i.e. (T)) here? probably not?
source.Append($@"
settings.{prop.Name} = {converionStr}{arg.ToCSharpString()};");