Use nullablePublicOnly flag explicitly in source and ref assemblies#39174
Conversation
|
I'm not familiar with these projects to give any meaningful code review feedback. If you can verify that mscorlib.dll with your fix doesn't have any method with IL code, that would be great (it should strictly have type forwarder declarations only) |
I did verify it on a local build. |
ca1fd68 to
dc4ffb3
Compare
dc4ffb3 to
e9140f6
Compare
|
I don't think I like this heuristic. We have 100s of assemblies that are going to have this additional attribute even if they don't need it / use it. That's not limited to just the shims. Here's a couple other ideas: 1) compiler only emits this when needed 2) compiler errors when its needed and not requested and we more selectively enable it in our projects. |
|
That is what I suggested here: #38887 (comment) I agree, the compiler shouldn't emit it if not needed. |
|
@cston opened: dotnet/roslyn#36977 So I think once we get that fixed, we will be able to use the feature flag globally without any conditions. Will merge this as is until we get a new compiler with that fixed. |
Fixes: https://github.com/dotnet/coreclr/issues/25522
By adding the flag when
IsTestProject != trueit was passing down this flag for shim projects as well, which was causing the compiler to include some typedefs and attributes to the shims (mscorlib, etc).cc: @stephentoub @sergiy-k @fadimounir