Skip to content

Inferred type in async expression bodied methods does not unwrap Task #27647

@Neme12

Description

@Neme12
using System.Threading.Tasks;

class C
{
    async Task<int> M1()
    {
        return foo; // correctly generates int
    }

    async Task<int> M2() => foo; // generates Task<int>
}

If I choose to generate a field in M1, its type will be int. If I do the same inside M2, the type of the field will be Task<int>, which is wrong.

Metadata

Metadata

Assignees

Labels

Area-IDEBugResolution-FixedThe bug has been fixed and/or the requested behavior has been implemented

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions