Skip to content

Commit 266d638

Browse files
authored
C#: fix warnings in generated code; add new CLI options (#981)
This adds two new options to the C# codegen CLI: - `--internal`: make symbols `internal` rather than `public` by default - `--skip-support-files`: skip generating the `cabi_realloc`, component type and similar files Those are both useful for generating code that we plan to ship as part of the .NET runtime. In that case, we don't want any of the generated code to be exposed as part of the public API, and we leave it to the application to supply `cabi_realloc` and the component type. The other changes address warnings and lints encountered when adding generated code to the .NET runtime codebase, e.g. XML validation in doc comments, trailing whitespace, redundant function signature modifiers, etc. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
1 parent 61e1c3e commit 266d638

File tree

3 files changed

+231
-168
lines changed

3 files changed

+231
-168
lines changed

crates/csharp/src/RepTable.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ internal int Add(T v) {
2222
if (firstVacant.HasValue) {
2323
rep = firstVacant.Value;
2424
firstVacant = ((Vacant) list[rep]).next;
25-
list[rep] = v;
25+
list[rep] = v!;
2626
} else {
2727
rep = list.Count;
28-
list.Add(v);
28+
list.Add(v!);
2929
}
3030
return rep;
3131
}

0 commit comments

Comments
 (0)