Skip to content

fix: init properties #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing ChildBaseFullyQualified requires init args.");
return new ChildBaseFullyQualified() {
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default!
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default(string)!
};
}
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing Child requires init args.");
return new Child() {
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default!
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default(string)!
};
}
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing Child2 requires init args.");
return new Child2() {
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default!
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default(string)!
};
}
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing ChildBaseFullyQualified requires init args.");
return new ChildBaseFullyQualified() {
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default!
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default(string)!
};
}
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
Name: "Name",
IsInit: true,
IsRequired: true,
Getter: (object obj) => ((BaseClass)obj).Name,
Getter: static (object obj) => ((BaseClass)obj).Name,
Setter: null,
GenericType: new GenericType(
OpenType: typeof(string),
Expand Down Expand Up @@ -57,7 +57,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing BaseClass requires init args.");
return new BaseClass() {
Name = args.ContainsKey("Name") ? (string)args["Name"] : default!
Name = args.ContainsKey("Name") ? (string)args["Name"] : default(string)!
};
}
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing Child requires init args.");
return new Child() {
Name = args.ContainsKey("Name") ? (string)args["Name"] : default!
Name = args.ContainsKey("Name") ? (string)args["Name"] : default(string)!
};
}
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing ChildBaseFullyQualified requires init args.");
return new ChildBaseFullyQualified() {
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default!
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default(string)!
};
}
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
public object Construct(System.Collections.Generic.IReadOnlyDictionary<string, object?>? args = null) {
args = args ?? throw new System.ArgumentNullException(nameof(args), "Constructing ChildWithStaticBaseRef requires init args.");
return new ChildWithStaticBaseRef() {
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default!
Identifier = args.ContainsKey("Identifier") ? (string)args["Identifier"] : default(string)!
};
}
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
IsInit: false,
IsRequired: false,
Getter: null,
Setter: (object obj, object? value) => ((SetOnlyProperty)obj).Value = (string)value!,
Setter: static (object obj, object? value) => ((SetOnlyProperty)obj).Value = (string)value!,
GenericType: new GenericType(
OpenType: typeof(string),
ClosedType: typeof(string),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
Name: "Name",
IsInit: false,
IsRequired: false,
Getter: (object obj) => ((BaseModel)obj).Name,
Setter: (object obj, object? value) => ((BaseModel)obj).Name = (string)value!,
Getter: static (object obj) => ((BaseModel)obj).Name,
Setter: static (object obj, object? value) => ((BaseModel)obj).Name = (string)value!,
GenericType: new GenericType(
OpenType: typeof(string),
ClosedType: typeof(string),
Expand Down
Loading
Loading