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

C# 8.0 nullable reference types #1425

Merged
merged 22 commits into from
Mar 2, 2019
Merged

Conversation

dgrunwald
Copy link
Member

This is an initial implementation that adds the ? in signatures involving nullable reference types.

Note that there's many situations where the nullability is not explicitly stored in the assembly, but would have to be inferred in order to avoid compiler warnings. We don't attempt to do this yet; all non-signature types will use non-nullable reference types.

dgrunwald and others added 20 commits February 16, 2019 21:00
…eferenced assemblies.

This can happen if an application is compiled for .NET 4.6.2 and references
System.ValueTuple.dll; but ILSpy loads the latest mscorlib (e.g. .NET 4.7)
which also contains struct System.ValueTuple.
This fixes compiling CustomAttributeConflicts.cs with legacy csc.
The changes to our test runner infrastructure and some cosmetic changes to the test cases caused some minor differences here.
Remove the committed .il files: these were originally intended to prevent test failures due to differences in the C# compiler on the system.
But legacy csc stopped changing long ago; and roslyn is tested via NuGet package, so everyone is using the same version.

Interestingly enough, avoiding the roundtrip through ildasm/ilasm caused some test failures due to changes in the order of top-level types.
So I've started sorting the types by name to ensure consistency in the tests. This required adjusting some existing tests.
@siegfriedpammer siegfriedpammer merged commit 76e641f into master Mar 2, 2019
@siegfriedpammer siegfriedpammer deleted the nullable-reference-types branch April 13, 2019 22:56
ElektroKill added a commit to dnSpyEx/ILSpy that referenced this pull request Jul 15, 2021
…ce-types

C# 8.0 nullable reference types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants