Skip to content

Commit

Permalink
Address more PROTOTYPE comments (#72113)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekseyTs authored Feb 16, 2024
1 parent 7ddc662 commit ba462cc
Show file tree
Hide file tree
Showing 5 changed files with 525 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2882,9 +2882,6 @@ private ImmutableArray<IArgumentOperation> CreateDisposeArguments(MethodArgument
return ImmutableArray<IArgumentOperation>.Empty;
}

// PROTOTYPE(ParamsCollections): Adjust?
Debug.Assert(!patternDisposeInfo.Expanded || patternDisposeInfo.Method.GetParameters().Last().OriginalDefinition.Type.IsSZArray());

var args = DeriveArguments(
patternDisposeInfo.Method,
patternDisposeInfo.Arguments,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1100,15 +1100,15 @@ private bool IsValidExtensionMethodSignature()
case RefKind.Ref:
case RefKind.In:
case RefKind.RefReadOnlyParameter:
return !parameter.IsParams; // PROTOTYPE(ParamsCollections): Test this code path
return !parameter.IsParams;
default:
return false;
}
}

private bool IsValidUserDefinedOperatorSignature(int parameterCount)
{
if (this.ReturnsVoid || this.IsGenericMethod || this.IsVararg || this.ParameterCount != parameterCount || this.IsParams()) // PROTOTYPE(ParamsCollections): Test this code path
if (this.ReturnsVoid || this.IsGenericMethod || this.IsVararg || this.ParameterCount != parameterCount || this.IsParams())
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected sealed override void MethodChecks(BindingDiagnosticBag diagnostics)

if (this.IsVararg && (IsGenericMethod || ContainingType.IsGenericType || _lazyParameters.Length > 0 && _lazyParameters[_lazyParameters.Length - 1].IsParams))
{
diagnostics.Add(ErrorCode.ERR_BadVarargs, location); // PROTOTYPE(ParamsCollections): Test this code path
diagnostics.Add(ErrorCode.ERR_BadVarargs, location);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ private static void PartialMethodChecks(SourceOrdinaryMethodSymbol definition, S
diagnostics.Add(ErrorCode.ERR_PartialMethodUnsafeDifference, implementation.GetFirstLocation());
}

if (definition.IsParams() != implementation.IsParams()) // PROTOTYPE(ParamsCollections): Test this code path
if (definition.IsParams() != implementation.IsParams())
{
diagnostics.Add(ErrorCode.ERR_PartialMethodParamsDifference, implementation.GetFirstLocation());
}
Expand Down Expand Up @@ -899,7 +899,7 @@ private void CheckModifiers(bool isExplicitInterfaceImplementation, Location loc
}
else if (isVararg && (IsGenericMethod || ContainingType.IsGenericType || Parameters.Length > 0 && Parameters[Parameters.Length - 1].IsParams))
{
diagnostics.Add(ErrorCode.ERR_BadVarargs, location); // PROTOTYPE(ParamsCollections): Test this code path
diagnostics.Add(ErrorCode.ERR_BadVarargs, location);
}
else if (isVararg && IsAsync)
{
Expand Down
Loading

0 comments on commit ba462cc

Please sign in to comment.