Skip to content

Instantly share code, notes, and snippets.

@jaredpar
Last active January 31, 2022 12:19
Show Gist options
  • Save jaredpar/4453b7b5d084e55385aece7d3d79e55f to your computer and use it in GitHub Desktop.
Save jaredpar/4453b7b5d084e55385aece7d3d79e55f to your computer and use it in GitHub Desktop.
buffalo.cs
using System;
using System.Runtime.CompilerServices;
class await {
async async async(async async) => await async(async(async));
}
[AsyncMethodBuilder(typeof(builder))]
delegate async async(async async);
static class util {
public static awaiter GetAwaiter(this await a) => throw null;
public static awaiter GetAwaiter(this async a) => throw null;
}
class awaiter : INotifyCompletion {
public bool IsCompleted => true;
public void GetResult() { }
public void OnCompleted(Action continuation) { }
}
class builder
{
public builder() { }
public static builder Create() => throw null;
public void SetResult() { }
public void SetException(Exception e) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine)
where TStateMachine : IAsyncStateMachine => throw null;
public async Task => throw null;
public void AwaitOnCompleted<TAwaiter, TStateMachine>(
ref TAwaiter awaiter, ref TStateMachine stateMachine)
where TAwaiter : INotifyCompletion
where TStateMachine : IAsyncStateMachine => throw null;
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(
ref TAwaiter awaiter, ref TStateMachine stateMachine)
where TAwaiter : ICriticalNotifyCompletion
where TStateMachine : IAsyncStateMachine => throw null;
public void SetStateMachine(IAsyncStateMachine stateMachine) => throw null;
}
@terrajobst
Copy link

@jaredpar
Copy link
Author

elmo

@333fred
Copy link

333fred commented Oct 20, 2021

using System;
using System.Runtime.CompilerServices;

async async async(async async) => await async[async][async][async][async];

[AsyncMethodBuilder(typeof(builder))]
class async {
    public async this[async async] { get => null; }
}

static class util { 
   public static awaiter GetAwaiter(this async a) => throw null;
}

class awaiter : INotifyCompletion {
    public bool IsCompleted => true;
    public void GetResult() { }
    public void OnCompleted(Action continuation) { }
}

class builder
{
    public builder() { }
    public static builder Create() => throw null;
    public void SetResult() { }
    public void SetException(Exception e) { }
    public void Start<TStateMachine>(ref TStateMachine stateMachine)
        where TStateMachine : IAsyncStateMachine => throw null;
    public async Task => throw null;
    public void AwaitOnCompleted<TAwaiter, TStateMachine>(
        ref TAwaiter awaiter, ref TStateMachine stateMachine)
        where TAwaiter : INotifyCompletion
        where TStateMachine : IAsyncStateMachine => throw null;
    public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(
        ref TAwaiter awaiter, ref TStateMachine stateMachine)
        where TAwaiter : ICriticalNotifyCompletion
        where TStateMachine : IAsyncStateMachine => throw null;
    public void SetStateMachine(IAsyncStateMachine stateMachine) => throw null;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment