You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling the project, the following error occurs:
MemoryPack.Generator\MemoryPack.Generator.MemoryPackGenerator\dto.MemoryPackFormatter.g.cs(172,30): error CS8987: The 'scoped' modifier of parameter 'value' doesn't match overridden or implemented member.
This error arises because the scoped modifier in the generated CurrencyFormatter class doesn't align with the overridden or implemented member in the base class MemoryPackFormatter. The inconsistency stems from differing checks within the generator for .NET version (NET7_0_OR_GREATER) and language version (C# 11).
The code generator uses inconsistent logic for determining when to apply the scoped modifier. Specifically, it checks for NET7_0_OR_GREATER in one part of the generator, and language version 11 in another part. This discrepancy leads to the scoped modifier being applied in the generated code when it's incompatible with the base class definition.
Proposed Solution
Ensure consistent logic within the code generator for applying the scoped modifier. Unify the checks for .NET version and language version to avoid inconsistencies. Specifically, review the following code in the generator:
and the language version check, and ensure they are aligned. The scoped modifier should only be added if both checks pass, or if a single check correctly determines the need for the modifier.
The text was updated successfully, but these errors were encountered:
Description
When compiling the project, the following error occurs:
This error arises because the
scoped
modifier in the generatedCurrencyFormatter
class doesn't align with the overridden or implemented member in the base classMemoryPackFormatter
. The inconsistency stems from differing checks within the generator for .NET version (NET7_0_OR_GREATER
) and language version (C# 11).Enviroment
Unity6, language version 11
Code
Generated Code:
Base Class:
Root Cause
The code generator uses inconsistent logic for determining when to apply the
scoped
modifier. Specifically, it checks forNET7_0_OR_GREATER
in one part of the generator, and language version 11 in another part. This discrepancy leads to thescoped
modifier being applied in the generated code when it's incompatible with the base class definition.Proposed Solution
Ensure consistent logic within the code generator for applying the
scoped
modifier. Unify the checks for .NET version and language version to avoid inconsistencies. Specifically, review the following code in the generator:and the language version check, and ensure they are aligned. The
scoped
modifier should only be added if both checks pass, or if a single check correctly determines the need for the modifier.The text was updated successfully, but these errors were encountered: