未验证 提交 09d57252 编写于 作者: R Rikki Gibson 提交者: GitHub

Check partial method return type compatibility (#45128)

上级 ec5ddecf
......@@ -5389,6 +5389,12 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<data name="WRN_NullabilityMismatchInParameterTypeOnPartial_Title" xml:space="preserve">
<value>Nullability of reference types in type of parameter doesn't match partial method declaration.</value>
</data>
<data name="WRN_NullabilityMismatchInReturnTypeOnPartial" xml:space="preserve">
<value>Nullability of reference types in return type doesn't match partial method declaration.</value>
</data>
<data name="WRN_NullabilityMismatchInReturnTypeOnPartial_Title" xml:space="preserve">
<value>Nullability of reference types in return type doesn't match partial method declaration.</value>
</data>
<data name="WRN_NullabilityMismatchInTypeOnImplicitImplementation" xml:space="preserve">
<value>Nullability of reference types in type of '{0}' doesn't match implicitly implemented member '{1}'.</value>
</data>
......@@ -6172,6 +6178,12 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<data name="ERR_PartialMethodExtendedModDifference" xml:space="preserve">
<value>Both partial method declarations must have identical combinations of 'virtual', 'override', 'sealed', and 'new' modifiers.</value>
</data>
<data name="ERR_PartialMethodReturnTypeDifference" xml:space="preserve">
<value>Both partial method declarations must have the same return type.</value>
</data>
<data name="ERR_PartialMethodRefReturnDifference" xml:space="preserve">
<value>Partial method declarations must have matching ref return values.</value>
</data>
<data name="IDS_TopLevelStatements" xml:space="preserve">
<value>top-level statements</value>
</data>
......
......@@ -1818,6 +1818,14 @@ internal enum ErrorCode
ERR_CannotConvertAddressOfToDelegate = 8811,
ERR_AddressOfToNonFunctionPointer = 8812,
// Codes 8813, 8814, 8815, 8816 used by features/module-initializers
ERR_PartialMethodReturnTypeDifference = 8817,
ERR_PartialMethodRefReturnDifference = 8818,
WRN_NullabilityMismatchInReturnTypeOnPartial = 8819,
// Codes 8820, 8821 used by features/static-lambdas
ERR_ExpressionTreeContainsWithExpression = 8849,
ERR_BadRecordDeclaration = 8850,
ERR_DuplicateRecordConstructor = 8851,
......
......@@ -49,6 +49,7 @@ static ErrorFacts()
nullableWarnings.Add(getId(ErrorCode.WRN_NullabilityMismatchInTypeOnOverride));
nullableWarnings.Add(getId(ErrorCode.WRN_NullabilityMismatchInReturnTypeOnOverride));
nullableWarnings.Add(getId(ErrorCode.WRN_NullabilityMismatchInReturnTypeOnPartial));
nullableWarnings.Add(getId(ErrorCode.WRN_NullabilityMismatchInParameterTypeOnOverride));
nullableWarnings.Add(getId(ErrorCode.WRN_NullabilityMismatchInParameterTypeOnPartial));
nullableWarnings.Add(getId(ErrorCode.WRN_NullabilityMismatchInTypeOnImplicitImplementation));
......@@ -399,6 +400,7 @@ internal static int GetWarningLevel(ErrorCode code)
case ErrorCode.WRN_NullReferenceArgument:
case ErrorCode.WRN_NullabilityMismatchInTypeOnOverride:
case ErrorCode.WRN_NullabilityMismatchInReturnTypeOnOverride:
case ErrorCode.WRN_NullabilityMismatchInReturnTypeOnPartial:
case ErrorCode.WRN_NullabilityMismatchInParameterTypeOnOverride:
case ErrorCode.WRN_NullabilityMismatchInParameterTypeOnPartial:
case ErrorCode.WRN_NullabilityMismatchInConstraintsOnPartialImplementation:
......
......@@ -243,6 +243,7 @@ public static bool IsWarning(ErrorCode code)
case ErrorCode.WRN_GeneratorFailedDuringGeneration:
case ErrorCode.WRN_GivenExpressionAlwaysMatchesPattern:
case ErrorCode.WRN_IsPatternAlways:
case ErrorCode.WRN_NullabilityMismatchInReturnTypeOnPartial:
return true;
default:
return false;
......
......@@ -1079,11 +1079,11 @@ static void checkOverriddenProperty(PropertySymbol overridingProperty, PropertyS
checkParameters ? ReportBadParameter : null,
overridingMemberLocation);
}
}
static bool IsOrContainsErrorType(TypeSymbol typeSymbol)
{
return (object)typeSymbol.VisitType((currentTypeSymbol, unused1, unused2) => currentTypeSymbol.IsErrorType(), (object)null) != null;
}
internal static bool IsOrContainsErrorType(TypeSymbol typeSymbol)
{
return (object)typeSymbol.VisitType((currentTypeSymbol, unused1, unused2) => currentTypeSymbol.IsErrorType(), (object)null) != null;
}
static readonly ReportMismatchInReturnType<Location> ReportBadReturn =
......
......@@ -1149,6 +1149,20 @@ private static void PartialMethodChecks(SourceOrdinaryMethodSymbol definition, S
{
Debug.Assert(!ReferenceEquals(definition, implementation));
MethodSymbol constructedDefinition = definition.ConstructIfGeneric(implementation.TypeArgumentsWithAnnotations);
bool returnTypesEqual = constructedDefinition.ReturnTypeWithAnnotations.Equals(implementation.ReturnTypeWithAnnotations, TypeCompareKind.AllIgnoreOptions);
if (!returnTypesEqual
&& !SourceMemberContainerTypeSymbol.IsOrContainsErrorType(implementation.ReturnType)
&& !SourceMemberContainerTypeSymbol.IsOrContainsErrorType(definition.ReturnType))
{
diagnostics.Add(ErrorCode.ERR_PartialMethodReturnTypeDifference, implementation.Locations[0]);
}
if (definition.RefKind != implementation.RefKind)
{
diagnostics.Add(ErrorCode.ERR_PartialMethodRefReturnDifference, implementation.Locations[0]);
}
if (definition.IsStatic != implementation.IsStatic)
{
diagnostics.Add(ErrorCode.ERR_PartialMethodStaticDifference, implementation.Locations[0]);
......@@ -1192,15 +1206,22 @@ private static void PartialMethodChecks(SourceOrdinaryMethodSymbol definition, S
SourceMemberContainerTypeSymbol.CheckValidNullableMethodOverride(
implementation.DeclaringCompilation,
definition.ConstructIfGeneric(implementation.TypeArgumentsWithAnnotations),
constructedDefinition,
implementation,
diagnostics,
reportMismatchInReturnType: null,
(diagnostics, implementedMethod, implementingMethod, topLevel, returnTypesEqual) =>
{
if (returnTypesEqual)
{
// report only if this is an unsafe *nullability* difference
diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInReturnTypeOnPartial, implementingMethod.Locations[0]);
}
},
(diagnostics, implementedMethod, implementingMethod, implementingParameter, blameAttributes, arg) =>
{
diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInParameterTypeOnPartial, implementingMethod.Locations[0], new FormattedSymbol(implementingParameter, SymbolDisplayFormat.ShortFormat));
},
extraArgument: (object)null);
extraArgument: returnTypesEqual);
}
private static void PartialMethodConstraintsChecks(SourceOrdinaryMethodSymbol definition, SourceOrdinaryMethodSymbol implementation, DiagnosticBag diagnostics)
......
......@@ -572,6 +572,16 @@
<target state="translated">Obě deklarace částečné metody musí mít modifikátor readonly, nebo nesmí mít modifikátor readonly žádná z nich.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodRefReturnDifference">
<source>Partial method declarations must have matching ref return values.</source>
<target state="new">Partial method declarations must have matching ref return values.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodReturnTypeDifference">
<source>Both partial method declarations must have the same return type.</source>
<target state="new">Both partial method declarations must have the same return type.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodWithAccessibilityModsMustHaveImplementation">
<source>Partial method '{0}' must have an implementation part because it has accessibility modifiers.</source>
<target state="new">Partial method '{0}' must have an implementation part because it has accessibility modifiers.</target>
......@@ -2164,6 +2174,16 @@
<target state="translated">Typ odkazu s možnou hodnotou null ve vráceném typu neodpovídá přepsanému členu.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial_Title">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInTypeOnExplicitImplementation">
<source>Nullability of reference types in type doesn't match implemented member '{0}'.</source>
<target state="translated">Typ odkazu s možnou hodnotou null v typu neodpovídá implementovanému členu {0}.</target>
......
......@@ -572,6 +572,16 @@
<target state="translated">Entweder beide oder keine der partiellen Methodendeklarationen müssen als "readonly" festgelegt werden.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodRefReturnDifference">
<source>Partial method declarations must have matching ref return values.</source>
<target state="new">Partial method declarations must have matching ref return values.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodReturnTypeDifference">
<source>Both partial method declarations must have the same return type.</source>
<target state="new">Both partial method declarations must have the same return type.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodWithAccessibilityModsMustHaveImplementation">
<source>Partial method '{0}' must have an implementation part because it has accessibility modifiers.</source>
<target state="new">Partial method '{0}' must have an implementation part because it has accessibility modifiers.</target>
......@@ -2164,6 +2174,16 @@
<target state="translated">Die NULL-Zulässigkeit von Verweistypen im Rückgabetyp entspricht nicht dem außer Kraft gesetzten Member.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial_Title">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInTypeOnExplicitImplementation">
<source>Nullability of reference types in type doesn't match implemented member '{0}'.</source>
<target state="translated">Die NULL-Zulässigkeit von Verweistypen im Typ entspricht nicht dem implementierten Member "{0}".</target>
......
......@@ -572,6 +572,16 @@
<target state="translated">Ambas declaraciones de métodos parciales deben ser de solo lectura o ninguna de ellas puede ser de solo lectura</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodRefReturnDifference">
<source>Partial method declarations must have matching ref return values.</source>
<target state="new">Partial method declarations must have matching ref return values.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodReturnTypeDifference">
<source>Both partial method declarations must have the same return type.</source>
<target state="new">Both partial method declarations must have the same return type.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodWithAccessibilityModsMustHaveImplementation">
<source>Partial method '{0}' must have an implementation part because it has accessibility modifiers.</source>
<target state="new">Partial method '{0}' must have an implementation part because it has accessibility modifiers.</target>
......@@ -2164,6 +2174,16 @@
<target state="translated">La nulabilidad de los tipos de referencia en el tipo de valor devuelto no coincide con el miembro reemplazado</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial_Title">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInTypeOnExplicitImplementation">
<source>Nullability of reference types in type doesn't match implemented member '{0}'.</source>
<target state="translated">La nulabilidad de los tipos de referencia del tipo no coincide con el miembro implementado "{0}".</target>
......
......@@ -572,6 +572,16 @@
<target state="translated">Soit les deux déclarations de méthodes partielles sont readonly, soit aucune ne l'est</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodRefReturnDifference">
<source>Partial method declarations must have matching ref return values.</source>
<target state="new">Partial method declarations must have matching ref return values.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodReturnTypeDifference">
<source>Both partial method declarations must have the same return type.</source>
<target state="new">Both partial method declarations must have the same return type.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodWithAccessibilityModsMustHaveImplementation">
<source>Partial method '{0}' must have an implementation part because it has accessibility modifiers.</source>
<target state="new">Partial method '{0}' must have an implementation part because it has accessibility modifiers.</target>
......@@ -2164,6 +2174,16 @@
<target state="translated">La nullabilité des types référence dans le type de retour ne correspond pas au membre substitué.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial_Title">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInTypeOnExplicitImplementation">
<source>Nullability of reference types in type doesn't match implemented member '{0}'.</source>
<target state="translated">La nullabilité des types référence dans le type ne correspond pas au membre implémenté '{0}'.</target>
......
......@@ -572,6 +572,16 @@
<target state="translated">Nessuna o entrambe le dichiarazioni di metodi parziali devono essere di tipo readonly</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodRefReturnDifference">
<source>Partial method declarations must have matching ref return values.</source>
<target state="new">Partial method declarations must have matching ref return values.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodReturnTypeDifference">
<source>Both partial method declarations must have the same return type.</source>
<target state="new">Both partial method declarations must have the same return type.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodWithAccessibilityModsMustHaveImplementation">
<source>Partial method '{0}' must have an implementation part because it has accessibility modifiers.</source>
<target state="new">Partial method '{0}' must have an implementation part because it has accessibility modifiers.</target>
......@@ -2164,6 +2174,16 @@
<target state="translated">Il supporto dei valori Null dei tipi riferimento nel tipo restituito non corrisponde al membro di cui è stato eseguito l'override.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial_Title">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInTypeOnExplicitImplementation">
<source>Nullability of reference types in type doesn't match implemented member '{0}'.</source>
<target state="translated">Il supporto dei valori Null dei tipi riferimento nel tipo non corrisponde al membro implementato '{0}'.</target>
......
......@@ -572,6 +572,16 @@
<target state="translated">部分メソッド宣言は、両方とも readonly であるか、両方とも readonly でないかのいずれかである必要があります</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodRefReturnDifference">
<source>Partial method declarations must have matching ref return values.</source>
<target state="new">Partial method declarations must have matching ref return values.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodReturnTypeDifference">
<source>Both partial method declarations must have the same return type.</source>
<target state="new">Both partial method declarations must have the same return type.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodWithAccessibilityModsMustHaveImplementation">
<source>Partial method '{0}' must have an implementation part because it has accessibility modifiers.</source>
<target state="new">Partial method '{0}' must have an implementation part because it has accessibility modifiers.</target>
......@@ -2164,6 +2174,16 @@
<target state="translated">戻り値の型における参照型の Null 許容性が、オーバーライドされるメンバーと一致しません。</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial_Title">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInTypeOnExplicitImplementation">
<source>Nullability of reference types in type doesn't match implemented member '{0}'.</source>
<target state="translated">型における参照型の Null 許容性が、実装されるメンバー '{0}' と一致しません。</target>
......
......@@ -572,6 +572,16 @@
<target state="translated">두 부분 메서드(Partial method) 선언 모두 readonly이거나 readonly가 아니어야 합니다.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodRefReturnDifference">
<source>Partial method declarations must have matching ref return values.</source>
<target state="new">Partial method declarations must have matching ref return values.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodReturnTypeDifference">
<source>Both partial method declarations must have the same return type.</source>
<target state="new">Both partial method declarations must have the same return type.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodWithAccessibilityModsMustHaveImplementation">
<source>Partial method '{0}' must have an implementation part because it has accessibility modifiers.</source>
<target state="new">Partial method '{0}' must have an implementation part because it has accessibility modifiers.</target>
......@@ -2164,6 +2174,16 @@
<target state="translated">반환 형식에 있는 참조 형식 Null 허용 여부가 재정의된 멤버와 일치하지 않습니다.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial_Title">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInTypeOnExplicitImplementation">
<source>Nullability of reference types in type doesn't match implemented member '{0}'.</source>
<target state="translated">형식에 있는 참조 형식 Null 허용 여부가 구현된 멤버 '{0}'과(와) 일치하지 않습니다.</target>
......
......@@ -572,6 +572,16 @@
<target state="translated">Obie metody częściowe muszą być zadeklarowane jako readonly lub żadna nie może być zadeklarowana jako readonly</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodRefReturnDifference">
<source>Partial method declarations must have matching ref return values.</source>
<target state="new">Partial method declarations must have matching ref return values.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodReturnTypeDifference">
<source>Both partial method declarations must have the same return type.</source>
<target state="new">Both partial method declarations must have the same return type.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodWithAccessibilityModsMustHaveImplementation">
<source>Partial method '{0}' must have an implementation part because it has accessibility modifiers.</source>
<target state="new">Partial method '{0}' must have an implementation part because it has accessibility modifiers.</target>
......@@ -2164,6 +2174,16 @@
<target state="translated">Obsługa wartości null dla typów referencyjnych w typie zwracanym jest niezgodna z przesłoniętą składową.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial_Title">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInTypeOnExplicitImplementation">
<source>Nullability of reference types in type doesn't match implemented member '{0}'.</source>
<target state="translated">Obsługa wartości null dla typów referencyjnych w typie jest niezgodna z implementowaną składową „{0}”.</target>
......
......@@ -572,6 +572,16 @@
<target state="translated">As duas declarações de métodos parciais precisam ser readonly ou nenhuma deve ser readonly</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodRefReturnDifference">
<source>Partial method declarations must have matching ref return values.</source>
<target state="new">Partial method declarations must have matching ref return values.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodReturnTypeDifference">
<source>Both partial method declarations must have the same return type.</source>
<target state="new">Both partial method declarations must have the same return type.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodWithAccessibilityModsMustHaveImplementation">
<source>Partial method '{0}' must have an implementation part because it has accessibility modifiers.</source>
<target state="new">Partial method '{0}' must have an implementation part because it has accessibility modifiers.</target>
......@@ -2162,6 +2172,16 @@
<target state="translated">A anulabilidade de tipos de referência em tipo de retorno não corresponde ao membro substituído.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial_Title">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInTypeOnExplicitImplementation">
<source>Nullability of reference types in type doesn't match implemented member '{0}'.</source>
<target state="translated">A anulabilidade de tipos de referência em tipo não corresponde ao membro implementado '{0}'.</target>
......
......@@ -572,6 +572,16 @@
<target state="translated">Либо оба объявления разделяемого метода должны иметь модификатор readonly, либо ни одно из них не должно иметь модификатор readonly.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodRefReturnDifference">
<source>Partial method declarations must have matching ref return values.</source>
<target state="new">Partial method declarations must have matching ref return values.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodReturnTypeDifference">
<source>Both partial method declarations must have the same return type.</source>
<target state="new">Both partial method declarations must have the same return type.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodWithAccessibilityModsMustHaveImplementation">
<source>Partial method '{0}' must have an implementation part because it has accessibility modifiers.</source>
<target state="new">Partial method '{0}' must have an implementation part because it has accessibility modifiers.</target>
......@@ -2164,6 +2174,16 @@
<target state="translated">Допустимость значения NULL для ссылочных типов в возвращаемом типе не совпадает с переопределенным членом.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial_Title">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInTypeOnExplicitImplementation">
<source>Nullability of reference types in type doesn't match implemented member '{0}'.</source>
<target state="translated">Допустимость значения NULL для ссылочных типов в типе не совпадает с реализованным членом "{0}".</target>
......
......@@ -572,6 +572,16 @@
<target state="translated">İki kısmi yöntem bildiriminin de saltokunur olması ya da hiçbirinin saltokunur olmaması gerekir</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodRefReturnDifference">
<source>Partial method declarations must have matching ref return values.</source>
<target state="new">Partial method declarations must have matching ref return values.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodReturnTypeDifference">
<source>Both partial method declarations must have the same return type.</source>
<target state="new">Both partial method declarations must have the same return type.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodWithAccessibilityModsMustHaveImplementation">
<source>Partial method '{0}' must have an implementation part because it has accessibility modifiers.</source>
<target state="new">Partial method '{0}' must have an implementation part because it has accessibility modifiers.</target>
......@@ -2164,6 +2174,16 @@
<target state="translated">Dönüş türündeki başvuru türlerinin boş değer atanabilirliği, geçersiz kılınan üye ile eşleşmiyor.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial_Title">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInTypeOnExplicitImplementation">
<source>Nullability of reference types in type doesn't match implemented member '{0}'.</source>
<target state="translated">Türdeki başvuru türlerinin boş değer atanabilirliği, uygulanan '{0}' üyesi ile eşleşmiyor.</target>
......
......@@ -572,6 +572,16 @@
<target state="translated">两个分部方法声明必须都是只读声明,或者两者都不能是只读声明</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodRefReturnDifference">
<source>Partial method declarations must have matching ref return values.</source>
<target state="new">Partial method declarations must have matching ref return values.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodReturnTypeDifference">
<source>Both partial method declarations must have the same return type.</source>
<target state="new">Both partial method declarations must have the same return type.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodWithAccessibilityModsMustHaveImplementation">
<source>Partial method '{0}' must have an implementation part because it has accessibility modifiers.</source>
<target state="new">Partial method '{0}' must have an implementation part because it has accessibility modifiers.</target>
......@@ -2164,6 +2174,16 @@
<target state="translated">返回类型中引用类型的为 Null 性与重写成员不匹配。</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial_Title">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInTypeOnExplicitImplementation">
<source>Nullability of reference types in type doesn't match implemented member '{0}'.</source>
<target state="translated">类型中引用类型的为 Null 性与实现的成员“{0}”不匹配。</target>
......
......@@ -572,6 +572,16 @@
<target state="translated">兩個部份方法宣告必須都為唯讀,或者都不為唯讀</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodRefReturnDifference">
<source>Partial method declarations must have matching ref return values.</source>
<target state="new">Partial method declarations must have matching ref return values.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodReturnTypeDifference">
<source>Both partial method declarations must have the same return type.</source>
<target state="new">Both partial method declarations must have the same return type.</target>
<note />
</trans-unit>
<trans-unit id="ERR_PartialMethodWithAccessibilityModsMustHaveImplementation">
<source>Partial method '{0}' must have an implementation part because it has accessibility modifiers.</source>
<target state="new">Partial method '{0}' must have an implementation part because it has accessibility modifiers.</target>
......@@ -2164,6 +2174,16 @@
<target state="translated">傳回型別中參考型別的可 Null 性與覆寫的成員不符合。</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInReturnTypeOnPartial_Title">
<source>Nullability of reference types in return type doesn't match partial method declaration.</source>
<target state="new">Nullability of reference types in return type doesn't match partial method declaration.</target>
<note />
</trans-unit>
<trans-unit id="WRN_NullabilityMismatchInTypeOnExplicitImplementation">
<source>Nullability of reference types in type doesn't match implemented member '{0}'.</source>
<target state="translated">型別中參考型別的可 Null 性與實作的成員 '{0}' 不符合。</target>
......
......@@ -274,6 +274,7 @@ public void WarningLevel_2()
case ErrorCode.WRN_DisallowNullAttributeForbidsMaybeNullAssignment:
case ErrorCode.WRN_NullabilityMismatchInTypeOnOverride:
case ErrorCode.WRN_NullabilityMismatchInReturnTypeOnOverride:
case ErrorCode.WRN_NullabilityMismatchInReturnTypeOnPartial:
case ErrorCode.WRN_NullabilityMismatchInParameterTypeOnOverride:
case ErrorCode.WRN_NullabilityMismatchInParameterTypeOnPartial:
case ErrorCode.WRN_NullabilityMismatchInConstraintsOnPartialImplementation:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册