master
neuecc 2020-06-29 03:02:23 +09:00
parent c49f1ed028
commit 9d684006fc
1 changed files with 39 additions and 1 deletions

View File

@ -1,4 +1,6 @@
using Cysharp.Threading.Tasks; #pragma warning disable CS1998
using Cysharp.Threading.Tasks;
using System.Linq; using System.Linq;
using System; using System;
@ -56,6 +58,24 @@ namespace NetCoreSandbox
} }
class Foo
{
public async UniTask MethodFooAsync()
{
await MethodBarAsync();
}
private async UniTask MethodBarAsync()
{
Throw();
}
private void Throw()
{
throw new Exception();
}
}
public struct TestAwaiter : ICriticalNotifyCompletion public struct TestAwaiter : ICriticalNotifyCompletion
{ {
@ -277,6 +297,24 @@ namespace NetCoreSandbox
#endif #endif
// await new AllocationCheck().ViaUniTaskVoid(); // await new AllocationCheck().ViaUniTaskVoid();
var buttonTest = new AsyncReactiveProperty<AsyncUnit>(AsyncUnit.Default);
buttonTest
.Subscribe(async _ =>
{
try
{
await new Foo().MethodFooAsync();
}
catch (Exception e)
{
Console.WriteLine(e.StackTrace);
}
});
buttonTest.Value = AsyncUnit.Default;
// AsyncTest().Forge // AsyncTest().Forge
Console.WriteLine("A?"); Console.WriteLine("A?");