You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript got never type which allows to define methods that never return.
I propose similar feature for C#.
Methods "returning" noreturn type must definitely throw or call other noreturn methods.
They can't have return statements in their body nor out parameters. At callsites they should be threated by the compiler similarly to throw statements.
It will require support from CLR. and that's a good thing as CLR could take advantage of that and optimize generated code around callsites to noreturns as it does now with throws.
TypeScript got
never
type which allows to define methods that never return.I propose similar feature for C#.
Methods "returning"
noreturn
type must definitely throw or call othernoreturn
methods.They can't have
return
statements in their body norout
parameters. At callsites they should be threated by the compiler similarly tothrow
statements.It will require support from CLR. and that's a good thing as CLR could take advantage of that and optimize generated code around callsites to
noreturn
s as it does now withthrow
s.The text was updated successfully, but these errors were encountered: