Last active
September 30, 2023 22:29
-
-
Save oSumAtrIX/3eafb53a34e4fe5bccc4b545f8a2f057 to your computer and use it in GitHub Desktop.
Shenanigans with Roslyn and the C# type checker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int a = 1, b = 2, c = 3; | |
System.Console.WriteLine( | |
"{0} {1}", | |
a < b, | |
c > (1 + 2) | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Program { | |
static void Main() => | |
F(a => | |
F(b => | |
F(c => | |
F(d => | |
F(e => | |
F(f => | |
F(g => | |
F(h => | |
F(i => | |
F(j => | |
F(k => | |
F(l => | |
F(m => | |
F(n => | |
F(o => | |
F(p => | |
F(q => | |
F(r => | |
F(s => | |
F(t => | |
F(u => | |
F(v => | |
F(w => | |
F(x => null) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
) | |
); | |
static object F(Func<True, object> f) => null; | |
static object F(Func<False, object> f) => null; | |
} | |
class True {} | |
class False {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main() { | |
} | |
} | |
class C<a, b, c, d, e, f> | |
{ | |
class I : C<I, I, I, I, I, I> { | |
I.I.I.I.I.I.I.I.I i; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment