Skip to content

Commit f63f76a

Browse files
author
Joanna May
authored
Merge pull request #6 from chickensoft-games/fix/required-props
fix: init properties
2 parents 0441f36 + ddd191c commit f63f76a

File tree

39 files changed

+273
-203
lines changed

39 files changed

+273
-203
lines changed

Chickensoft.Introspection.Generator.Tests/.generated/Chickensoft.Introspection.Generator/Chickensoft.Introspection.Generator.TypeGenerator/A_ChildBaseFullyQualified58F37FBE84.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
4242
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
4343
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing ChildBaseFullyQualified requires init args.");
4444
return new ChildBaseFullyQualified() {
45-
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default!
45+
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default(string)!
4646
};
4747
}
4848
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]

Chickensoft.Introspection.Generator.Tests/.generated/Chickensoft.Introspection.Generator/Chickensoft.Introspection.Generator.TypeGenerator/AliasedStuff_Nested_Child.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
4343
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
4444
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing Child requires init args.");
4545
return new Child() {
46-
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default!
46+
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default(string)!
4747
};
4848
}
4949
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]

Chickensoft.Introspection.Generator.Tests/.generated/Chickensoft.Introspection.Generator/Chickensoft.Introspection.Generator.TypeGenerator/AliasedStuff_Nested_Child2.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
4343
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
4444
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing Child2 requires init args.");
4545
return new Child2() {
46-
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default!
46+
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default(string)!
4747
};
4848
}
4949
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]

Chickensoft.Introspection.Generator.Tests/.generated/Chickensoft.Introspection.Generator/Chickensoft.Introspection.Generator.TypeGenerator/B_ChildBaseFullyQualifiedF9E7B51DD8.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
4343
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
4444
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing ChildBaseFullyQualified requires init args.");
4545
return new ChildBaseFullyQualified() {
46-
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default!
46+
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default(string)!
4747
};
4848
}
4949
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]

Chickensoft.Introspection.Generator.Tests/.generated/Chickensoft.Introspection.Generator/Chickensoft.Introspection.Generator.TypeGenerator/BaseClasses_A_BaseClass.g.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
2323
Name: "Name",
2424
IsInit: true,
2525
IsRequired: true,
26-
Getter: (object obj) => ((BaseClass)obj).Name,
26+
Getter: static (object obj) => ((BaseClass)obj).Name,
2727
Setter: null,
2828
GenericType: new GenericType(
2929
OpenType: typeof(string),
@@ -57,7 +57,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
5757
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
5858
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing BaseClass requires init args.");
5959
return new BaseClass() {
60-
Name = args.ContainsKey("Name") ? (string)args["Name"] : default!
60+
Name = args.ContainsKey("Name") ? (string)args["Name"] : default(string)!
6161
};
6262
}
6363
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]

Chickensoft.Introspection.Generator.Tests/.generated/Chickensoft.Introspection.Generator/Chickensoft.Introspection.Generator.TypeGenerator/BaseClasses_B_Child.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
4242
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
4343
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing Child requires init args.");
4444
return new Child() {
45-
Name = args.ContainsKey("Name") ? (string)args["Name"] : default!
45+
Name = args.ContainsKey("Name") ? (string)args["Name"] : default(string)!
4646
};
4747
}
4848
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]

Chickensoft.Introspection.Generator.Tests/.generated/Chickensoft.Introspection.Generator/Chickensoft.Introspection.Generator.TypeGenerator/C_ChildBaseFullyQualifiedD92201992B.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
4444
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
4545
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing ChildBaseFullyQualified requires init args.");
4646
return new ChildBaseFullyQualified() {
47-
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default!
47+
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default(string)!
4848
};
4949
}
5050
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]

Chickensoft.Introspection.Generator.Tests/.generated/Chickensoft.Introspection.Generator/Chickensoft.Introspection.Generator.TypeGenerator/StaticUsings_ChildWithStaticBaseRef.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
4242
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
4343
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing ChildWithStaticBaseRef requires init args.");
4444
return new ChildWithStaticBaseRef() {
45-
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default!
45+
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default(string)!
4646
};
4747
}
4848
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]

Chickensoft.Introspection.Generator.Tests/.generated/Chickensoft.Introspection.Generator/Chickensoft.Introspection.Generator.TypeGenerator/TestCases_SetOnlyPropertyE303C8557E.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
2222
IsInit: false,
2323
IsRequired: false,
2424
Getter: null,
25-
Setter: (object obj, object? value) => ((SetOnlyProperty)obj).Value = (string)value!,
25+
Setter: static (object obj, object? value) => ((SetOnlyProperty)obj).Value = (string)value!,
2626
GenericType: new GenericType(
2727
OpenType: typeof(string),
2828
ClosedType: typeof(string),

Chickensoft.Introspection.Generator.Tests/.generated/Chickensoft.Introspection.Generator/Chickensoft.Introspection.Generator.TypeGenerator/Tests_TestCases_BaseModel6634CD33B5.g.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
2424
Name: "Name",
2525
IsInit: false,
2626
IsRequired: false,
27-
Getter: (object obj) => ((BaseModel)obj).Name,
28-
Setter: (object obj, object? value) => ((BaseModel)obj).Name = (string)value!,
27+
Getter: static (object obj) => ((BaseModel)obj).Name,
28+
Setter: static (object obj, object? value) => ((BaseModel)obj).Name = (string)value!,
2929
GenericType: new GenericType(
3030
OpenType: typeof(string),
3131
ClosedType: typeof(string),

0 commit comments

Comments
 (0)