private void PostProcessSkippedValueTypeFields()

in src/Refasmer/Importer/ImportLogic.cs [643:655]


    private void PostProcessSkippedValueTypeFields(
        List<FieldDefinition> skippedFields,
        List<FieldDefinition> importedFields)
    {
        if (importedFields.Count > 0) return; // we have imported some fields, no need to make the struct non-empty
        if (skippedFields.Count == 0) return; // we haven't skipped any fields; the struct was empty to begin with

        // We have skipped all fields, so we need to add a dummy field to make the struct non-empty.
        _builder.AddFieldDefinition(
            FieldAttributes.Private,
            _builder.GetOrAddString("<SyntheticNonEmptyStructMarker>"),
            _builder.GetOrAddBlob(new[] { (byte)SignatureKind.Field, (byte)SignatureTypeCode.Int32 }));
    }