Skip to content

Commit dc810de

Browse files
committed
[Proto] Use Tag as the indexer of ProtoObjectInfo
1 parent c3bb76d commit dc810de

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lagrange.Proto.Generator/ProtoSourceGenerator.Emitter.TypeInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ private PropertyDeclarationSyntax EmitTypeInfoProperty()
4040
private MethodDeclarationSyntax EmitTypeInfoCreationMethod()
4141
{
4242
var fields = parser.Fields.ToDictionary(
43-
kv => kv.Key,
43+
kv => (kv.Key << 3) | (byte)kv.Value.WireType,
4444
kv => SF.ObjectCreationExpression(SF.ParseTypeName($"global::Lagrange.Proto.Serialization.Metadata.ProtoFieldInfo<{kv.Value.TypeSyntax}>"))
4545
.WithArgumentList(SF.ArgumentList(
4646
SF.SeparatedList<ArgumentSyntax>(

0 commit comments

Comments
 (0)