Skip to content

Commit

Permalink
Do not allow extensions as an argument to makeMapFieldInfo()
Browse files Browse the repository at this point in the history
  • Loading branch information
timostamm committed Jan 18, 2024
1 parent 4f9f909 commit eb9a200
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/protobuf/src/create-registry-from-desc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ function makeFieldInfo(
): PartialFieldInfo {
switch (desc.fieldKind) {
case "map":
assert(desc.kind == "field"); // maps are not allowed for extensions
return makeMapFieldInfo(desc, resolver);
case "message":
return makeMessageFieldInfo(desc, resolver);
Expand All @@ -297,7 +298,7 @@ function makeFieldInfo(
}

function makeMapFieldInfo(
field: (DescField | DescExtension) & { fieldKind: "map" },
field: DescField & { fieldKind: "map" },
resolver: Resolver,
): PartialFieldInfo {
const base = {
Expand Down

0 comments on commit eb9a200

Please sign in to comment.