dotnet / dotnet/linker

Add nullable annotations to reference assembly

Open
#2,302 0 comments 0 reactions 0 assignees View on GitHub
area-Build
Dominant language
C#
Stars
392
Forks
128
Avg merge
2d 10h
Merged PRs (30d)
2

Description

The custom step APIs in the linker's reference assembly should have nullable annotations. When I tried to enable them, ApiCompat produced errors about NullableContextAttribute that I'm not sure how to work around:
```
error : CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.NullableContextAttribute' exists on 'Mono.Linker.MessageOrigin..ctor(Mono.Cecil.IMemberDefinition, System.Nullable)' in the contract but not the implementation. [/home/sven/linker/src/linker/Mono.Linker.csproj
```

I think this is happening because the compiler decides how to emit NullableContextAttribute based on which annotations are most common in a type, which could be different in the ref assembly.

For future reference, we also need to disable CS8597 to prevent warnings about "throw null" in the ref assembly.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.