Shaolinq
Shaolinq copied to clipboard
AsyncRewriter fails when used on expression body method
Steps to reproduce:
- Create class library project targeting .NET 4.6
- Install
Shaolinq.AsyncRewriter 1.1.1.989
- Create new class:
public partial class Class1
{
[RewriteAsync]
public int Foo() => 10;
}
- Try to build the project
This will produce an invalid C# code in GeneratedAsync.cs
file:
namespace ClassLibrary3
{
#pragma warning disable
using System;
using System.Threading;
using System.Threading.Tasks;
using global::ClassLibrary3;
public partial class Class1
{
public Task<int> FooAsync()
{
return FooAsync(CancellationToken.None);
}
=> 10;
public async Task<int> FooAsync(CancellationToken cancellationToken) => 10;
}
}