Skip to content

Commit ddd191c

Browse files
author
Joanna May
committed
fix: use static closures
1 parent 2a92fc6 commit ddd191c

23 files changed

+178
-176
lines changed

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
@@ -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),

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),

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

Lines changed: 89 additions & 89 deletions
Large diffs are not rendered by default.

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
2525
Name: "Age",
2626
IsInit: false,
2727
IsRequired: false,
28-
Getter: (object obj) => ((MyModel)obj).Age,
29-
Setter: (object obj, object? value) => ((MyModel)obj).Age = (int)value,
28+
Getter: static (object obj) => ((MyModel)obj).Age,
29+
Setter: static (object obj, object? value) => ((MyModel)obj).Age = (int)value,
3030
GenericType: new GenericType(
3131
OpenType: typeof(int),
3232
ClosedType: typeof(int),
@@ -44,8 +44,8 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
4444
Name: "Name",
4545
IsInit: false,
4646
IsRequired: false,
47-
Getter: (object obj) => ((MyModel)obj).Name,
48-
Setter: (object obj, object? value) => ((MyModel)obj).Name = (string)value!,
47+
Getter: static (object obj) => ((MyModel)obj).Name,
48+
Setter: static (object obj, object? value) => ((MyModel)obj).Name = (string)value!,
4949
GenericType: new GenericType(
5050
OpenType: typeof(string),
5151
ClosedType: typeof(string),
@@ -79,8 +79,8 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
7979

8080
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
8181
public System.Collections.Generic.IReadOnlyDictionary<System.Type, System.Action<object>> MixinHandlers { get; } = new System.Collections.Generic.Dictionary<System.Type, System.Action<object>>() {
82-
[typeof(IMyMixin)] = (obj) => ((IMyMixin)obj).Handler(),
83-
[typeof(IMySecondMixin)] = (obj) => ((IMySecondMixin)obj).Handler()
82+
[typeof(IMyMixin)] = static (obj) => ((IMyMixin)obj).Handler(),
83+
[typeof(IMySecondMixin)] = static (obj) => ((IMySecondMixin)obj).Handler()
8484
};
8585

8686

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
3333

3434
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
3535
public System.Collections.Generic.IReadOnlyDictionary<System.Type, System.Action<object>> MixinHandlers { get; } = new System.Collections.Generic.Dictionary<System.Type, System.Action<object>>() {
36-
[typeof(ISomeMixin)] = (obj) => ((ISomeMixin)obj).Handler()
36+
[typeof(ISomeMixin)] = static (obj) => ((ISomeMixin)obj).Handler()
3737
};
3838

3939

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
2525
Name: "DeepName",
2626
IsInit: true,
2727
IsRequired: true,
28-
Getter: (object obj) => ((DeeplyNestedBaseClass)obj).DeepName,
28+
Getter: static (object obj) => ((DeeplyNestedBaseClass)obj).DeepName,
2929
Setter: null,
3030
GenericType: new GenericType(
3131
OpenType: typeof(string),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
2727
Name: "Identifier",
2828
IsInit: true,
2929
IsRequired: true,
30-
Getter: (object obj) => ((SomeBaseClass)obj).Identifier,
30+
Getter: static (object obj) => ((SomeBaseClass)obj).Identifier,
3131
Setter: null,
3232
GenericType: new GenericType(
3333
OpenType: typeof(string),

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
2828
Name: "MyProperty",
2929
IsInit: false,
3030
IsRequired: false,
31-
Getter: (object obj) => ((MyType)obj).MyProperty,
32-
Setter: (object obj, object? value) => ((MyType)obj).MyProperty = (string)value!,
31+
Getter: static (object obj) => ((MyType)obj).MyProperty,
32+
Setter: static (object obj, object? value) => ((MyType)obj).MyProperty = (string)value!,
3333
GenericType: new GenericType(
3434
OpenType: typeof(string),
3535
ClosedType: typeof(string),
@@ -51,7 +51,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
5151
Name: "NoAttributeSoNoMetadata",
5252
IsInit: false,
5353
IsRequired: false,
54-
Getter: (object obj) => ((MyType)obj).NoAttributeSoNoMetadata,
54+
Getter: static (object obj) => ((MyType)obj).NoAttributeSoNoMetadata,
5555
Setter: null,
5656
GenericType: new GenericType(
5757
OpenType: typeof(int),
@@ -67,8 +67,8 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
6767
Name: "OptionalFloat",
6868
IsInit: false,
6969
IsRequired: false,
70-
Getter: (object obj) => ((MyType)obj).OptionalFloat,
71-
Setter: (object obj, object? value) => ((MyType)obj).OptionalFloat = (Nullable<float>)value,
70+
Getter: static (object obj) => ((MyType)obj).OptionalFloat,
71+
Setter: static (object obj, object? value) => ((MyType)obj).OptionalFloat = (Nullable<float>)value,
7272
GenericType: new GenericType(
7373
OpenType: typeof(Nullable<>),
7474
ClosedType: typeof(Nullable<float>),
@@ -94,8 +94,8 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
9494
Name: "OptionalInt",
9595
IsInit: false,
9696
IsRequired: false,
97-
Getter: (object obj) => ((MyType)obj).OptionalInt,
98-
Setter: (object obj, object? value) => ((MyType)obj).OptionalInt = (int)value,
97+
Getter: static (object obj) => ((MyType)obj).OptionalInt,
98+
Setter: static (object obj, object? value) => ((MyType)obj).OptionalInt = (int)value,
9999
GenericType: new GenericType(
100100
OpenType: typeof(int),
101101
ClosedType: typeof(int),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class MetatypeMetadata : Chickensoft.Introspection.IMetatype {
2424
Name: "Name",
2525
IsInit: true,
2626
IsRequired: true,
27-
Getter: (object obj) => ((AttributesWithNamedArgs)obj).Name,
27+
Getter: static (object obj) => ((AttributesWithNamedArgs)obj).Name,
2828
Setter: null,
2929
GenericType: new GenericType(
3030
OpenType: typeof(string),

0 commit comments

Comments
 (0)