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:
parent
f2a4794105
commit
00e0a5fb2a
|
@ -58,9 +58,9 @@ public class DefaultSetterGenerator : ISourceGenerator
|
||||||
// this single arg is just the value assigned to the default value
|
// this single arg is just the value assigned to the default value
|
||||||
var arg = ctorArgs.Value[0];
|
var arg = ctorArgs.Value[0];
|
||||||
// a bit lame, but it'll work
|
// 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
|
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?
|
: ""; // do we need a cast (i.e. (T)) here? probably not?
|
||||||
source.Append($@"
|
source.Append($@"
|
||||||
settings.{prop.Name} = {converionStr}{arg.ToCSharpString()};");
|
settings.{prop.Name} = {converionStr}{arg.ToCSharpString()};");
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue