未验证 提交 a8b5e424 编写于 作者: J Julien Couvreur 提交者: GitHub

Enforce unconditional attributes within method bodies (#40789)

上级 01625ff8
......@@ -100,4 +100,11 @@ could be different than the one that compiler used to find.
16. In *Visual Studio 2019 version 16.5* and language version 8.0 and later, the compiler will no longer accept `throw null` when there is no type `System.Exception`.
17. https://github.com/dotnet/roslyn/issues/39852 Previously the compiler would allow an invocation of an implicit index or range indexer to specify any named argument. In *Visual Studio 2019 version 16.5* argument names are no longer permitted for these invocations.
\ No newline at end of file
17. https://github.com/dotnet/roslyn/issues/39852 Previously the compiler would allow an invocation of an implicit index or range indexer to specify any named argument. In *Visual Studio 2019 version 16.5* argument names are no longer permitted for these invocations.
18. https://github.com/dotnet/roslyn/issues/36039 In *Visual Studio 2019 version 16.3* and onwards, the compiler only honored nullability flow annotation attributes for callers of an API. In *Visual Studio 2019 version 16.5* the compiler honors those attributes within member bodies.
For instance, returning `default` from a method declared with a `[MaybeNull] T` return type will no longer warn.
Similarly, a value from a `[DisallowNull] ref string? p` parameter will be assumed to be not-null when first read.
On the other hand, we'll warn for returning a `null` from a method declared with `[NotNull] string?` return type, and we'll treat the value from a `[AllowNull] ref string p` parameter as maybe-null.
Conditional attributes are treated leniently. For instance, no warning will be produced for assigning a maybe-null value to an `[MaybeNullWhen(...)] out string p` parameter.
......@@ -14021,7 +14021,7 @@ internal class CSharpResources {
}
/// <summary>
/// Looks up a localized string similar to A possible null value may not be assigned to a target marked with the [DisallowNull] attribute.
/// Looks up a localized string similar to A possible null value may not be used for a type marked with [NotNull] or [DisallowNull].
/// </summary>
internal static string WRN_DisallowNullAttributeForbidsMaybeNullAssignment {
get {
......@@ -14030,7 +14030,7 @@ internal class CSharpResources {
}
/// <summary>
/// Looks up a localized string similar to A possible null value may not be assigned to a target marked with the [DisallowNull] attribute.
/// Looks up a localized string similar to A possible null value may not be used for a type marked with [NotNull] or [DisallowNull].
/// </summary>
internal static string WRN_DisallowNullAttributeForbidsMaybeNullAssignment_Title {
get {
......
......@@ -5442,10 +5442,10 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<value>Argument cannot be used as an output for parameter due to differences in the nullability of reference types.</value>
</data>
<data name="WRN_DisallowNullAttributeForbidsMaybeNullAssignment" xml:space="preserve">
<value>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</value>
<value>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</value>
</data>
<data name="WRN_DisallowNullAttributeForbidsMaybeNullAssignment_Title" xml:space="preserve">
<value>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</value>
<value>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</value>
</data>
<data name="WRN_NullabilityMismatchInReturnTypeOfTargetDelegate" xml:space="preserve">
<value>Nullability of reference types in return type of '{0}' doesn't match the target delegate '{1}'.</value>
......
......@@ -1424,9 +1424,17 @@ private void EnterParameter(ParameterSymbol parameter, TypeWithAnnotations param
private static TypeWithState GetParameterState(TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations)
{
return ((parameterAnnotations & FlowAnalysisAnnotations.AllowNull) != 0) ?
TypeWithState.Create(parameterType.Type, NullableFlowState.MaybeDefault) :
parameterType.ToTypeWithState();
if ((parameterAnnotations & FlowAnalysisAnnotations.AllowNull) != 0)
{
return TypeWithState.Create(parameterType.Type, NullableFlowState.MaybeDefault);
}
if ((parameterAnnotations & FlowAnalysisAnnotations.DisallowNull) != 0)
{
return TypeWithState.Create(parameterType.Type, NullableFlowState.NotNull);
}
return parameterType.ToTypeWithState();
}
protected override BoundNode VisitReturnStatementNoAdjust(BoundReturnStatement node)
......@@ -1441,17 +1449,21 @@ protected override BoundNode VisitReturnStatementNoAdjust(BoundReturnStatement n
// Should not convert to method return type when inferring return type (when _returnTypesOpt != null).
if (_returnTypesOpt == null &&
TryGetReturnType(out TypeWithAnnotations returnType))
TryGetReturnType(out TypeWithAnnotations returnType, out FlowAnalysisAnnotations returnAnnotations))
{
TypeWithState returnState;
if (node.RefKind == RefKind.None)
{
VisitOptionalImplicitConversion(expr, returnType, useLegacyWarnings: false, trackMembers: false, AssignmentKind.Return);
returnState = VisitOptionalImplicitConversion(expr, returnType, useLegacyWarnings: false, trackMembers: false, AssignmentKind.Return);
}
else
{
// return ref expr;
VisitRefExpression(expr, returnType);
returnState = VisitRefExpression(expr, returnType);
}
// If the return has annotations, we perform an additional check for nullable value types
CheckDisallowedNullAssignment(returnState, ToInwardAnnotations(returnAnnotations), node.Syntax.Location, boundValueOpt: expr);
}
else
{
......@@ -1487,12 +1499,13 @@ private TypeWithState VisitRefExpression(BoundExpression expr, TypeWithAnnotatio
return resultType;
}
private bool TryGetReturnType(out TypeWithAnnotations type)
private bool TryGetReturnType(out TypeWithAnnotations type, out FlowAnalysisAnnotations annotations)
{
var method = CurrentSymbol as MethodSymbol;
if (method is null)
{
type = default;
annotations = FlowAnalysisAnnotations.None;
return false;
}
......@@ -1503,22 +1516,26 @@ private bool TryGetReturnType(out TypeWithAnnotations type)
if (returnType.IsVoidType())
{
type = default;
annotations = FlowAnalysisAnnotations.None;
return false;
}
if (!method.IsAsync)
{
type = ApplyUnconditionalAnnotations(returnType, delegateOrMethod.ReturnTypeFlowAnalysisAnnotations);
annotations = delegateOrMethod.ReturnTypeFlowAnalysisAnnotations;
type = ApplyUnconditionalAnnotations(returnType, annotations);
return true;
}
if (returnType.Type.IsGenericTaskType(compilation))
{
type = ((NamedTypeSymbol)returnType.Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single();
annotations = FlowAnalysisAnnotations.None;
return true;
}
type = default;
annotations = FlowAnalysisAnnotations.None;
return false;
}
......@@ -3361,21 +3378,11 @@ private void ReinferMethodAndVisitArguments(BoundCall node, TypeWithState receiv
{
returnState = returnState.WithNotNullState();
}
ReportMaybeNullFromTypeParameterValueIfNeeded(node, returnState, GetRValueAnnotations(method));
SetResult(node, returnState, method.ReturnTypeWithAnnotations);
SetUpdatedSymbol(node, node.Method, method);
}
/// <summary>
/// Members that return [MaybeNull]T values (for an unconstrained type parameter) produce a warning upon usage,
/// just like default(T).
/// </summary>
private void ReportMaybeNullFromTypeParameterValueIfNeeded(BoundExpression expr, TypeWithState typeWithState, FlowAnalysisAnnotations annotations)
{
// Not implemented. See https://github.com/dotnet/roslyn/issues/38638 for an alternative.
}
private void LearnFromEqualsMethod(MethodSymbol method, BoundCall node, TypeWithState receiverType, ImmutableArray<VisitArgumentResult> results)
{
// easy out
......@@ -3391,7 +3398,6 @@ private void LearnFromEqualsMethod(MethodSymbol method, BoundCall node, TypeWith
return;
}
var isStaticEqualsMethod = method.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__EqualsObjectObject))
|| method.Equals(compilation.GetSpecialTypeMember(SpecialMember.System_Object__ReferenceEquals));
if (isStaticEqualsMethod ||
......@@ -3635,6 +3641,11 @@ private static TypeWithAnnotations ApplyUnconditionalAnnotations(TypeWithAnnotat
return declaredType.AsAnnotated();
}
if ((annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull)
{
return declaredType.AsNotAnnotated();
}
return declaredType;
}
......@@ -4020,12 +4031,40 @@ private VisitArgumentResult VisitArgumentEvaluate(BoundExpression argument, RefK
Debug.Assert(!this.IsConditionalState);
}
private void CheckDisallowedNullAssignment(TypeWithState state, FlowAnalysisAnnotations annotations, Location location)
private void CheckDisallowedNullAssignment(TypeWithState state, FlowAnalysisAnnotations annotations, Location location, BoundExpression boundValueOpt = null)
{
if (((annotations & FlowAnalysisAnnotations.DisallowNull) != 0) && state.Type.IsNullableTypeOrTypeParameter() && state.MayBeNull)
if (boundValueOpt is { WasCompilerGenerated: true })
{
// We need to skip `return backingField;` in auto-prop getters
return;
}
// We do this extra check for types whose non-nullable version cannot be represented
if (((annotations & FlowAnalysisAnnotations.DisallowNull) != 0) && hasNoNonNullableCounterpart(state.Type) && state.MayBeNull)
{
ReportDiagnostic(ErrorCode.WRN_DisallowNullAttributeForbidsMaybeNullAssignment, location);
}
static bool hasNoNonNullableCounterpart(TypeSymbol type)
{
if (type is null)
{
return false;
}
// Some types that could receive a maybe-null value have a NotNull counterpart:
// [NotNull]string? -> string
// [NotNull]string -> string
// [NotNull]TClass -> TClass
// [NotNull]TClass? -> TClass
//
// While others don't:
// [NotNull]int? -> X
// [NotNull]TNullable -> X
// [NotNull]TStruct? -> X
// [NotNull]TOpen -> X
return (type.Kind == SymbolKind.TypeParameter && !type.IsReferenceType) || type.IsNullableTypeOrTypeParameter();
}
}
/// <summary>
......@@ -4067,8 +4106,6 @@ private void CheckDisallowedNullAssignment(TypeWithState state, FlowAnalysisAnno
{
ReportNullableAssignmentIfNecessary(parameterValue, lValueType, applyPostConditionsUnconditionally(parameterWithState, parameterAnnotations), UseLegacyWarnings(argument, result.LValueType));
}
ReportMaybeNullFromTypeParameterValueIfNeeded(argument, parameterWithState, parameterAnnotations);
}
break;
case RefKind.Out:
......@@ -4114,8 +4151,6 @@ private void CheckDisallowedNullAssignment(TypeWithState state, FlowAnalysisAnno
ReportNullabilityMismatchInArgument(argument.Syntax, lValueType.Type, parameter, parameterType.Type, forOutput: true);
}
}
ReportMaybeNullFromTypeParameterValueIfNeeded(argument, parameterWithState, parameterAnnotations);
}
break;
default:
......@@ -6160,6 +6195,7 @@ private FlowAnalysisAnnotations GetLValueAnnotations(BoundExpression expr)
BoundFieldAccess field => getFieldAnnotations(field.FieldSymbol),
BoundObjectInitializerMember { MemberSymbol: PropertySymbol prop } => getSetterAnnotations(prop),
BoundObjectInitializerMember { MemberSymbol: FieldSymbol field } => getFieldAnnotations(field),
BoundParameter { ParameterSymbol: ParameterSymbol parameter } => ToInwardAnnotations(GetParameterAnnotations(parameter)),
_ => FlowAnalysisAnnotations.None
};
......@@ -6201,6 +6237,22 @@ static FlowAnalysisAnnotations getPropertyAnnotations(SourcePropertySymbol prope
}
}
private static FlowAnalysisAnnotations ToInwardAnnotations(FlowAnalysisAnnotations outwardAnnotations)
{
var annotations = FlowAnalysisAnnotations.None;
if ((outwardAnnotations & FlowAnalysisAnnotations.MaybeNull) != 0)
{
// MaybeNull and MaybeNullWhen count as MaybeNull
annotations |= FlowAnalysisAnnotations.AllowNull;
}
if ((outwardAnnotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull)
{
// NotNullWhenTrue and NotNullWhenFalse don't count on their own. Only NotNull (ie. both flags) matters.
annotations |= FlowAnalysisAnnotations.DisallowNull;
}
return annotations;
}
private static bool UseLegacyWarnings(BoundExpression expr, TypeWithAnnotations exprType)
{
switch (expr.Kind)
......@@ -6623,6 +6675,7 @@ public override BoundNode VisitIncrementOperator(BoundIncrementOperator node)
public override BoundNode VisitCompoundAssignmentOperator(BoundCompoundAssignmentOperator node)
{
var left = node.Left;
var right = node.Right;
Visit(left);
TypeWithAnnotations declaredType = LvalueResultType;
TypeWithAnnotations leftLValueType = declaredType;
......@@ -6655,13 +6708,13 @@ public override BoundNode VisitCompoundAssignmentOperator(BoundCompoundAssignmen
}
TypeWithState resultType;
TypeWithState rightType = VisitRvalueWithState(node.Right);
TypeWithState rightType = VisitRvalueWithState(right);
if ((object)node.Operator.ReturnType != null)
{
if (node.Operator.Kind.IsUserDefined() && (object)node.Operator.Method != null && node.Operator.Method.ParameterCount == 2)
{
MethodSymbol method = node.Operator.Method;
VisitArguments(node, ImmutableArray.Create(node.Left, node.Right), method.ParameterRefKinds, method.Parameters, argsToParamsOpt: default,
VisitArguments(node, ImmutableArray.Create(node.Left, right), method.ParameterRefKinds, method.Parameters, argsToParamsOpt: default,
expanded: true, invokedAsExtensionMethod: false, method);
}
......@@ -6884,11 +6937,6 @@ private Symbol VisitMemberAccess(BoundExpression node, BoundExpression receiverO
}
}
if (_expressionIsRead)
{
ReportMaybeNullFromTypeParameterValueIfNeeded(node, resultType, memberAnnotations);
}
SetResult(node, resultType, type);
return member;
}
......
......@@ -1380,12 +1380,12 @@
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Do cíle označeného atributem [DisallowNull] se nedá předat možná hodnota null</target>
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment_Title">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Do cíle označeného atributem [DisallowNull] se nedá předat možná hodnota null</target>
<note />
</trans-unit>
......
......@@ -1380,12 +1380,12 @@
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Ein möglicher NULL-Wert darf nicht an ein Ziel übergeben werden, das mit dem [DisallowNull]-Attribut markiert ist.</target>
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment_Title">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Ein möglicher NULL-Wert darf nicht an ein Ziel übergeben werden, das mit dem [DisallowNull]-Attribut markiert ist.</target>
<note />
</trans-unit>
......
......@@ -1381,12 +1381,12 @@
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">No se puede pasar un posible valor NULL a un destino marcado con el atributo [DisallowNull]</target>
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment_Title">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">No se puede pasar un posible valor NULL a un destino marcado con el atributo [DisallowNull]</target>
<note />
</trans-unit>
......
......@@ -1380,12 +1380,12 @@
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Vous ne devez pas passer une possible valeur null à une cible marquée avec l'attribut [DisallowNull]</target>
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment_Title">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Vous ne devez pas passer une possible valeur null à une cible marquée avec l'attribut [DisallowNull]</target>
<note />
</trans-unit>
......
......@@ -1380,12 +1380,12 @@
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Un possibile valore Null non può essere passato a una destinazione contrassegnata con l'attributo [DisallowNull]</target>
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment_Title">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Un possibile valore Null non può essere passato a una destinazione contrassegnata con l'attributo [DisallowNull]</target>
<note />
</trans-unit>
......
......@@ -1380,12 +1380,12 @@
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">[DisallowNull] 属性でマークされたターゲットに Null の可能性がある値を渡すことはできません</target>
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment_Title">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">[DisallowNull] 属性でマークされたターゲットに Null の可能性がある値を渡すことはできません</target>
<note />
</trans-unit>
......
......@@ -1380,12 +1380,12 @@
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">가능한 null 값은 [DisallowNull] 특성으로 표시된 대상에 전달할 수 없음</target>
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment_Title">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">가능한 null 값은 [DisallowNull] 특성으로 표시된 대상에 전달할 수 없음</target>
<note />
</trans-unit>
......
......@@ -1380,12 +1380,12 @@
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Możliwa wartość null nie może być przekazywana do elementu docelowego oznaczonego atrybutem [DisallowNull]</target>
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment_Title">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Możliwa wartość null nie może być przekazywana do elementu docelowego oznaczonego atrybutem [DisallowNull]</target>
<note />
</trans-unit>
......
......@@ -1380,12 +1380,12 @@
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Um possível valor nulo não pode ser passado para um destino marcado com o atributo [DisallowNull]</target>
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment_Title">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Um possível valor nulo não pode ser passado para um destino marcado com o atributo [DisallowNull]</target>
<note />
</trans-unit>
......
......@@ -1380,12 +1380,12 @@
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Возможное значение NULL не может быть передано целевому объекту, помеченному атрибутом [DisallowNull]</target>
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment_Title">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Возможное значение NULL не может быть передано целевому объекту, помеченному атрибутом [DisallowNull]</target>
<note />
</trans-unit>
......
......@@ -1380,12 +1380,12 @@
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Olası bir null değer, [DisallowNull] özniteliğiyle işaretlenmiş bir hedefe geçirilemez</target>
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment_Title">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">Olası bir null değer, [DisallowNull] özniteliğiyle işaretlenmiş bir hedefe geçirilemez</target>
<note />
</trans-unit>
......
......@@ -1380,12 +1380,12 @@
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">可能的 null 值可能不会传递到用 [DisallowNull] 属性标记的目标</target>
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment_Title">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">可能的 null 值可能不会传递到用 [DisallowNull] 属性标记的目标</target>
<note />
</trans-unit>
......
......@@ -1380,12 +1380,12 @@
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">可能為 null 的值,不能傳遞到標記了 [DisallowNull] 屬性的目標</target>
<note />
</trans-unit>
<trans-unit id="WRN_DisallowNullAttributeForbidsMaybeNullAssignment_Title">
<source>A possible null value may not be assigned to a target marked with the [DisallowNull] attribute</source>
<source>A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]</source>
<target state="needs-review-translation">可能為 null 的值,不能傳遞到標記了 [DisallowNull] 屬性的目標</target>
<note />
</trans-unit>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册