Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable nullable references #39

Closed
perlun opened this issue May 7, 2020 · 3 comments
Closed

Enable nullable references #39

perlun opened this issue May 7, 2020 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@perlun
Copy link
Collaborator

perlun commented May 7, 2020

Moved to GitLab

Please continue to the new version of this issue here: https://gitlab.perlang.org/perlang/perlang/-/issues/39. The GitHub page you are currently reading will not contain the latest information on this issue.


Nullable references (or rather, non-nullable references) is one of the cooler features in more recent versions of C# (more specifically, C# 8.0 or greater - .NET Core 3.0 and upwards) We have been a bit sloppy here, but we should enable these compiler flags to try and take advantage of this support right from start, especially since the Perlang language has strong ambitions regarding non-nullability in itself.

@perlun perlun added the enhancement New feature or request label May 7, 2020
@perlun
Copy link
Collaborator Author

perlun commented Sep 18, 2020

Some of this sneaked in as part of #77 being merged. I found out that it's possible to enable nullability warnings for individual files (like this). This is incredibly convenient, since it means we can gradually start moving towards more and more nullability types until the whole codebase is converted to use it.

The newly created Perlang.Tests project also has nullability support enabled project-wide. Perlang.Tests.Integration could be a reasonable next project to enable it for.

@perlun
Copy link
Collaborator Author

perlun commented Jun 13, 2022

Not (fully) accomplished in 0.2.0, postponing to a later iteration.

@perlun
Copy link
Collaborator Author

perlun commented Oct 17, 2023

Our current state of affairs, a few years later:

$ rg Nullable $(find -name \*.csproj)
./src/Perlang.Parser/Perlang.Parser.csproj
5:        <Nullable>disable</Nullable>

./src/Perlang.Interpreter/Perlang.Interpreter.csproj
5:        <Nullable>disable</Nullable>

./src/Perlang.Common/Perlang.Common.csproj
6:        <Nullable>disable</Nullable>

./src/Perlang.Tests/Perlang.Tests.csproj
6:        <Nullable>enable</Nullable>

I was reminded of this since I tried to enable it for Perlang.Parser now, but it's a bit of work to get it done. We should aim for doing this; it's not a huge effort and it will "feel good" to take null seriously. (in other words, try to avoid it at all costs. 😉)

@perlun perlun closed this as completed Aug 20, 2024
@perlang-org perlang-org locked as resolved and limited conversation to collaborators Aug 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant