Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change PROTOTYPE to issue reference #58336

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ internal BoundExpression MakeNullCheck(SyntaxNode syntax, BoundExpression rewrit

internal BoundExpression MakeNullableHasValue(SyntaxNode syntax, BoundExpression expression)
{
// PROTOTYPE(param-nullchecking): consider restoring the 'private' accessibility of 'static LocalRewriter.UnsafeGetNullableMethod()'
// https://github.com/dotnet/roslyn/issues/58335: consider restoring the 'private' accessibility of 'static LocalRewriter.UnsafeGetNullableMethod()'
return BoundCall.Synthesized(syntax, expression, LocalRewriter.UnsafeGetNullableMethod(syntax, expression.Type, CodeAnalysis.SpecialMember.System_Nullable_T_get_HasValue, Compilation, Diagnostics));
}

Expand Down Expand Up @@ -1673,7 +1673,7 @@ internal BoundExpression RewriteNullableNullEquality(

return result;
}
// PROTOTYPE(BangBang): Re-enable annotations
// https://github.com/dotnet/roslyn/issues/58335: Re-enable annotations
#nullable enable
}
}
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/Parser/LanguageParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11540,7 +11540,7 @@ bool isParenVarCommaSyntax()
return true;
}
// ( x!! , [...]
// PROTOTYPE(BangBang): https://github.com/dotnet/roslyn/pull/46520#discussion_r466650228
// https://github.com/dotnet/roslyn/issues/58335: https://github.com/dotnet/roslyn/pull/46520#discussion_r466650228
if (after.Kind == SyntaxKind.ExclamationToken
&& this.PeekToken(3).Kind == SyntaxKind.ExclamationToken
&& after.GetTrailingTriviaWidth() == 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -789,15 +789,15 @@ private static RefKind GetModifiers(SyntaxTokenList modifiers, out SyntaxToken r
return refKind;
}

// PROTOTYPE(param-nullchecking): consider whether we should adjust the set of locations where we call this
// https://github.com/dotnet/roslyn/issues/58335: consider whether we should adjust the set of locations where we call this
internal static void ReportParameterNullCheckingErrors(DiagnosticBag diagnostics, ParameterSymbol parameter)
{
if (!parameter.IsNullChecked)
{
return;
}
Location location = parameter.Locations.FirstOrNone();
// PROTOTYPE(param-nullchecking): can we simplify with the other overload?
// https://github.com/dotnet/roslyn/issues/58335: can we simplify with the other overload?
if (Binder.GetWellKnownTypeMember(parameter.DeclaringCompilation, WellKnownMember.System_ArgumentNullException__ctorString, out UseSiteInfo<AssemblySymbol> useSiteInfo) is null)
{
diagnostics.Add(useSiteInfo.DiagnosticInfo, location);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2408,7 +2408,7 @@ void M(string x!!) { }
Statements (0)");
}

[Fact(Skip = "PROTOTYPE(param-nullchecking): MakeMemberMissing doesn't work as expected with our method of obtaining Nullable<T>.HasValue in this scenario")]
[Fact(Skip = "https://github.com/dotnet/roslyn/issues/58335: MakeMemberMissing doesn't work as expected with our method of obtaining Nullable<T>.HasValue in this scenario")]
public void TestNullCheckedMethodWithMissingHasValue()
{
var source =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void M2(__arglist!!)
Diagnostic(ErrorCode.ERR_SyntaxError, "!").WithArguments(",", "!").WithLocation(8, 22));
}

[Fact(Skip = "PROTOTYPE(BangBang)")]
[Fact(Skip = "https://github.com/dotnet/roslyn/issues/58335")]
public void NullCheckedArgList()
{
var source = @"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ bool visitPossibleUsingDeclarationInLabel(ILabeledOperation labelOperation)

EnterRegion(new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: operation.Locals));

// PROTOTYPE(param-nullchecking): this implementation doesn't handle record primary constructors
// https://github.com/dotnet/roslyn/issues/58335: this implementation doesn't handle record primary constructors
if (operation.SemanticModel!.GetDeclaredSymbol(operation.Syntax) is IMethodSymbol method)
{
VisitNullChecks(operation, method.Parameters);
Expand All @@ -1502,7 +1502,7 @@ bool visitPossibleUsingDeclarationInLabel(ILabeledOperation labelOperation)
{
StartVisitingStatement(operation);

// PROTOTYPE(param-nullchecking): do we need to use SemanticModel here?
// https://github.com/dotnet/roslyn/issues/58335: do we need to use SemanticModel here?
var member = operation.SemanticModel!.GetDeclaredSymbol(operation.Syntax);
Debug.Assert(captureIdForResult is null);
VisitNullChecks(operation, ((IMethodSymbol)member!).Parameters);
Expand All @@ -1518,7 +1518,7 @@ private void VisitNullChecks(IOperation operation, ImmutableArray<IParameterSymb
{
if (param.IsNullChecked)
{
// PROTOTYPE(param-nullchecking): do we need to use SemanticModel here?
// https://github.com/dotnet/roslyn/issues/58335: do we need to use SemanticModel here?
var check = GenerateNullCheckForParameter(param, operation.Syntax, ((Operation)operation).OwningSemanticModel!);
_currentStatement = check;
VisitConditional(check, captureIdForResult: null);
Expand All @@ -1536,7 +1536,7 @@ private ConditionalOperation GenerateNullCheckForParameter(IParameterSymbol para
IOperation conditionOp;
if (ITypeSymbolHelpers.IsNullableType(parameter.Type))
{
// PROTOTYPE(param-nullchecking): is there a better way to get the HasValue symbol here?
// https://github.com/dotnet/roslyn/issues/58335: is there a better way to get the HasValue symbol here?
// This way doesn't work with compilation.MakeMemberMissing for testing
var nullableHasValueProperty = parameter.Type.GetMembers(nameof(Nullable<int>.HasValue)).FirstOrDefault() as IPropertySymbol;
var nullableHasValueGet = nullableHasValueProperty?.GetMethod;
Expand Down