Skip to content

Commit

Permalink
Fix java & dotnet code generator emitting unknown None symbol (#858)
Browse files Browse the repository at this point in the history
Fix java & dotnet code generator emitting unknown None symbol

Quite similar to 6d85020
and fixing building the java code for gxformat2.
  • Loading branch information
mvdbeek authored Aug 18, 2024
1 parent 71398c9 commit 659a884
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions schema_salad/dotnet_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,9 @@ def type_loader(
init="new MapLoader<{}>({}, {}, {})".format(
i.instance_type,
i.name,
f"'{container}'" if container is not None else None, # noqa: B907
(
f"'{container}'" if container is not None else self.to_dotnet(None)
), # noqa: B907
self.to_dotnet(no_link_check),
),
)
Expand All @@ -459,7 +461,9 @@ def type_loader(
name=self.safe_name(type_declaration["name"]) + "Loader",
init="new RecordLoader<{}>({}, {})".format(
self.safe_name(type_declaration["name"]),
f"'{container}'" if container is not None else None, # noqa: B907
(
f"'{container}'" if container is not None else self.to_dotnet(None)
), # noqa: B907
self.to_dotnet(no_link_check),
),
loader_type="ILoader<{}>".format(self.safe_name(type_declaration["name"])),
Expand Down
8 changes: 6 additions & 2 deletions schema_salad/java_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,9 @@ def type_loader(
name=f"map_of_{i.name}",
init="new MapLoader({}, {}, {})".format(
i.name,
f"'{container}'" if container is not None else None, # noqa: B907
(
f"'{container}'" if container is not None else self.to_java(None)
), # noqa: B907
self.to_java(no_link_check),
),
loader_type=f"Loader<java.util.Map<String, {i.instance_type}>>",
Expand All @@ -494,7 +496,9 @@ def type_loader(
clazz=fqclass,
ext="Impl" if not is_abstract else "",
container=(
f"'{container}'" if container is not None else None # noqa: B907
f"'{container}'"
if container is not None
else self.to_java(None) # noqa: B907
),
no_link_check=self.to_java(no_link_check),
),
Expand Down

0 comments on commit 659a884

Please sign in to comment.