Skip to content

Commit 0ae3a50

Browse files
committed
Fix build errors
1 parent f106960 commit 0ae3a50

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/DynamoDBGenerator.SourceGenerator/Generations/UnMarshaller.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,43 +100,43 @@ private static CodeFactory CreateMethod(ITypeSymbol type, Func<ITypeSymbol, Dyna
100100
SingleGeneric.SupportedType.Nullable => signature
101101
.CreateScope(
102102
$"if ({Value} is null || {Value}.NULL is true)"
103-
.CreateScope(singleGeneric.T.ReturnNullOrThrow(DataMember))
103+
.CreateScope(singleGeneric.TypeSymbol.ReturnNullOrThrow(DataMember))
104104
.Append($"return {InvokeUnmarshallMethod(singleGeneric.T, Value, DataMember, options)};" )
105105
)
106106
.ToConversion(singleGeneric.T),
107107
SingleGeneric.SupportedType.List or SingleGeneric.SupportedType.ICollection => signature
108108
.CreateScope(
109109
$"if ({Value} is null || {Value}.L is null)"
110-
.CreateScope(singleGeneric.T.ReturnNullOrThrow(DataMember))
110+
.CreateScope(singleGeneric.TypeSymbol.ReturnNullOrThrow(DataMember))
111111
.Append($"return {AttributeValueUtilityFactory.ToList}({Value}.L, {MarshallerOptions.ParamReference}, {DataMember}, static (a, o, d) => {InvokeUnmarshallMethod(singleGeneric.T, "a", "d", options, "o")});")
112112
)
113113
.ToConversion(singleGeneric.T),
114114
SingleGeneric.SupportedType.Array or SingleGeneric.SupportedType.IReadOnlyCollection => signature
115115
.CreateScope(
116116
$"if ({Value} is null || {Value}.L is null)"
117-
.CreateScope(singleGeneric.T.ReturnNullOrThrow(DataMember))
117+
.CreateScope(singleGeneric.TypeSymbol.ReturnNullOrThrow(DataMember))
118118
.Append($"return {AttributeValueUtilityFactory.ToArray}({Value}.L, {MarshallerOptions.ParamReference}, {DataMember}, static (a, o, d) => {InvokeUnmarshallMethod(singleGeneric.T, "a", "d", options, "o")});")
119119
)
120120
.ToConversion(singleGeneric.T),
121121
SingleGeneric.SupportedType.IEnumerable => signature
122122
.CreateScope(
123123
$"if ({Value} is null || {Value}.L is null)"
124-
.CreateScope(singleGeneric.T.ReturnNullOrThrow(DataMember))
124+
.CreateScope(singleGeneric.TypeSymbol.ReturnNullOrThrow(DataMember))
125125
.Append($"return {AttributeValueUtilityFactory.ToEnumerable}({Value}.L, {MarshallerOptions.ParamReference}, {DataMember}, static (a, o, d) => {InvokeUnmarshallMethod(singleGeneric.T, "a", "d", options, "o")});")
126126
)
127127
.ToConversion(singleGeneric.T),
128128
SingleGeneric.SupportedType.Set when singleGeneric.T.SpecialType is SpecialType.System_String => signature
129129
.CreateScope(
130130
$"if ({Value} is null || {Value}.SS is null)"
131-
.CreateScope(singleGeneric.T.ReturnNullOrThrow(DataMember))
131+
.CreateScope(singleGeneric.TypeSymbol.ReturnNullOrThrow(DataMember))
132132
.Append($"return new {(singleGeneric.TypeSymbol.TypeKind is TypeKind.Interface ? $"HashSet<{(singleGeneric.T.IsNullable() ? "string?" : "string")}>" : null)}({(singleGeneric.T.IsNullable() ? $"{Value}.SS" : $"{Value}.SS.Select((y,i) => y ?? throw {ExceptionHelper.NullExceptionMethod}($\"{{{DataMember}}}[UNKNOWN]\")")}));")
133133
)
134134
.ToConversion(),
135135
SingleGeneric.SupportedType.Set when singleGeneric.T.IsNumeric() => signature
136136
.CreateScope(
137137
$"if ({Value} is null || {Value}.NS is null)"
138-
.CreateScope(singleGeneric.T.ReturnNullOrThrow(DataMember))
139-
.Append($"return new {(singleGeneric.TypeSymbol.TypeKind is TypeKind.Interface ? $"HashSet<{singleGeneric.T.Representation().original}>" : null)}({Value}.NS.Select(y => {singleGeneric.T.Representation().original}.Parse(y)))")
138+
.CreateScope(singleGeneric.TypeSymbol.ReturnNullOrThrow(DataMember))
139+
.Append($"return new {(singleGeneric.TypeSymbol.TypeKind is TypeKind.Interface ? $"HashSet<{singleGeneric.T.Representation().original}>" : null)}({Value}.NS.Select(y => {singleGeneric.T.Representation().original}.Parse(y)));")
140140
)
141141
.ToConversion(singleGeneric.TypeSymbol),
142142
SingleGeneric.SupportedType.Set => throw new ArgumentException("Only string and integers are supported for sets", UncoveredConversionException(singleGeneric, nameof(CreateMethod))),

0 commit comments

Comments
 (0)