Skip to content

Trouble with null coalescing operator #112

@persn

Description

@persn

Conside the following code

[Zomp.SyncMethodGenerator.CreateSyncVersion]
internal partial class Foo
{
    public async Task FooFooAsync(Bark? bar)
    {
        await (bar?.BarBarAsync() ?? Task.CompletedTask);
    }
}

[Zomp.SyncMethodGenerator.CreateSyncVersion]
internal partial class Bark
{
    public async Task BarBarAsync()
    {
    }
}

It generates the following

internal partial class Foo
{
    public void FooFoo(global::LateStartStudio.EmptySpace.SaveGames.Bark? bar)
    {
    }
}

As we can see, the code inside the method was dropped completely. I expected it to generate bar?.BarBar();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions