Version Used:
3.6.0-2.20173.3+2242fa4fb945b97680bdd49eb5dd58285e4abb1c
Steps to Reproduce:
#nullable enable
using System;
public class C0 {
private static readonly String S1;
}
public class C1 {
private static readonly String S1 = null!;
}
Expected Behavior:
No cctor should be generated for either type, as in both cases S1 is null.
Actual Behavior:
An empty cctor is generated for C1:
.method private hidebysig specialname rtspecialname static
void .cctor () cil managed
{
// Method begins at RVA 0x2087
// Code size 1 (0x1)
.maxstack 8
IL_0000: ret
} // end of method C1::.cctor