gregoryyoung / nothing

Replacement of the System.Void type
The Unlicense
57 stars 11 forks source link

compiler optimization #42

Closed jcmrva closed 2 years ago

jcmrva commented 3 years ago

I'd like to use this but I'm concerned about the overhead of creating classes.

If Nothing is truly nothing then shouldn't it be removed at compile time? Otherwise it's technically something.

dsyme commented 3 years ago

True, List<Nothing> can be optimized to Nothing. This will require changes to .NET Generics in the C++ of the Common Language Runtime. The code is here if someone wants to make a start https://github.com/dotnet/coreclr

gregoryyoung commented 3 years ago

Do include a link to the PR here if you submit one for others to reference.

jcmrva commented 2 years ago

In the spirit of the project I wrote no code and submitted no PR. I think it handles the issue nicely.