Remove some C# warnings and making the client API safer by declaring nullables
This commit is contained in:
parent
d85ed22ea7
commit
5bde88e90b
@ -10549,7 +10549,7 @@ var CSharpTarget = class extends CompileTarget {
|
||||
a(1, `}`);
|
||||
} else {
|
||||
let ret = fnc.return ? fnc.return.array ? `IList<${toCSharpType(fnc.return.type)}>` : toCSharpType(fnc.return.type) : void 0;
|
||||
a(1, `public async Task<${ret}> ${fnc.name}(${params}) {`);
|
||||
a(1, `public async Task<${ret}?> ${fnc.name}(${params}) {`);
|
||||
genParam();
|
||||
a(2, `return await this.Client.SendRequest<${ret}>("${definition.name}.${fnc.name}", param);`);
|
||||
a(1, `}`);
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hibas123/jrpcgen",
|
||||
"version": "1.0.22",
|
||||
"version": "1.0.23",
|
||||
"main": "lib/index.js",
|
||||
"license": "MIT",
|
||||
"packageManager": "yarn@3.1.1",
|
||||
|
@ -174,7 +174,7 @@ export class CSharpTarget extends CompileTarget<{ csharp_namespace: string }> {
|
||||
? `IList<${toCSharpType(fnc.return.type)}>`
|
||||
: toCSharpType(fnc.return.type)
|
||||
: undefined;
|
||||
a(1, `public async Task<${ret}> ${fnc.name}(${params}) {`);
|
||||
a(1, `public async Task<${ret}?> ${fnc.name}(${params}) {`);
|
||||
genParam();
|
||||
a(
|
||||
2,
|
||||
|
Loading…
Reference in New Issue
Block a user