Skip to content

Commit

Permalink
[linker] Remove C#8 Nullable attributes (#4056)
Browse files Browse the repository at this point in the history
Fixes: #3911
Context: https://github.com/dotnet/roslyn/blob/7bc44488c661fd6bbb6c53f39512a6fe0cc5ef84/docs/features/nullable-metadata.md

C#8 [nullable reference types][0] use custom attributes to inform the
compiler about nullability information in the assembly.

These custom attributes shouldn't be needed when running on device,
as the C# language feature doesn't require modifications to the
runtime. Thus it should be safe to remove them.

[0]: https://docs.microsoft.com/en-us/dotnet/csharp/nullable-references
  • Loading branch information
radekdoulik authored and jonpryor committed Dec 20, 2019
1 parent bb36e3e commit 7ff7cb8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ protected override bool IsRemovedAttribute (CustomAttribute attribute)
case "DebuggerTypeProxyAttribute":
case "DebuggerVisualizerAttribute":
return !DebugBuild && attr_type.Namespace == "System.Diagnostics";
case "NullableContextAttribute":
case "NullableAttribute":
return attr_type.Namespace == "System.Runtime.CompilerServices";
default:
return false;
}
Expand Down

0 comments on commit 7ff7cb8

Please sign in to comment.