Skip to content

Instantly share code, notes, and snippets.

@Lachee
Created February 1, 2021 06:56
Show Gist options
  • Save Lachee/047734d3361076eba73129893d88a7e4 to your computer and use it in GitHub Desktop.
Save Lachee/047734d3361076eba73129893d88a7e4 to your computer and use it in GitHub Desktop.
I like keywords i guess
public class Why : Span<U>, IDisposable where U : struct
{
const sbyte BECAUSE_YES = 2;
public object Contents { get => (string)this; set { _ = value; } };
public void Dispose() { throw new NotImplementedException(); }
public static explicit operator string(Why y) { return "cause fuck you"; }
}
public async IAsyncEnumerable<T> OhGod<T>(T t) where T : Why
{
Span<byte> foo = stackalloc byte[4];
unsafe {
switch ((string)t)
{
default:
case "what":
yield return await new Task(() => { do { lock ((object)t) { using (var stream = new Why()) { dynamic a = stream.Contents is int; } } } while (true || false); }) is Int64 ? t : default;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment