Open Lordfirespeed opened 7 months ago
IsExternalInit
must be emitted all the time, for all frameworks. Even if the framework already declares it.
The explanation of why is here: https://github.com/manuelroemer/IsExternalInit/issues/5
"
IsExternalInit
must be emitted all the time, for all frameworks."
This is not accurate. PolySharp generates the correct [TypeForwardedTo]
in that case, instead of the polyfill. Not generating the polyfill is only a binary breaking changes if you don't generate the correct forwards, but PolySharp does that, so that's fine.
"Compilation succeeds, but
IsExternalInits
type is not included in the compiled assembly targeting netstandard2.1."
@Lordfirespeed I need more info from your end. First, I can't repro this:
Second, how is your project even compiling at all, if you're saying the .NET Standard 2.1 target doesn't have that polyfill?
Are you sure you're not looking at the wrong place or perhaps it was just VS not showing all generated files correctly?
@Sergio0694 You are quite right. Brilliant solution that I hadn't thought of so didn't check for. My apologies for spreading FUD.
All good, no worries! Just wanted to make sure there were no misunderstandings! 😊
Reproduction Steps
Make a project that targets
netstandard2.1
andnet8.0
and add a
record class
to it with some members, or alternatively a class withrequired init
properties.Expected Behavior
IsExternalInits
type should be included in the compiled assembly targetingnetstandard2.1
.Actual Behavior
Compilation succeeds, but
IsExternalInits
type is not included in the compiled assembly targetingnetstandard2.1
.System info
This section should contain useful info such as:
net48
andnetstandard2.1
)