Skip to content

Commit 2a92fc6

Browse files
author
Joanna May
committed
fix: only allow init args to be set at construction (and respect explicit default values)
1 parent 0441f36 commit 2a92fc6

26 files changed

+98
-30
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/_ChildBaseFullyQualified2447EE53E80.g.cs

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

Chickensoft.Introspection.Generator.Tests/.generated/Chickensoft.Introspection.Generator/Chickensoft.Introspection.Generator.TypeGenerator/e_ChildBaseFullyQualifiedF82AB94D12.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]

0 commit comments

Comments
 (0)