Skip to content
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
8 changes: 4 additions & 4 deletions src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3905,7 +3905,7 @@ private void CheckArgumentRefKind(RefKind argRefKind, BoundExpression argument,
}
else
{
// Tracked by https://github.com/dotnet/roslyn/issues/76130 : consider removing or adjusting the reported argument position
// Tracked by https://github.com/dotnet/roslyn/issues/78830 : diagnostic quality, consider removing or adjusting the reported argument position
var argNumber = invokedAsExtensionMethod ? arg : arg + 1;

// Warn for `ref`/`in` or None/`ref readonly` mismatch.
Expand Down Expand Up @@ -8629,7 +8629,7 @@ static bool tryResolveExtensionInScope(
// 3. resolve properties
Debug.Assert(arity == 0 || lookupResult.Symbols.All(s => s.Kind != SymbolKind.Property));

// Tracked by https://github.com/dotnet/roslyn/issues/76130 : Regarding 'acceptOnlyMethods', consider if it would be better to add a special 'LookupOptions' value to filter out properties during lookup
// Tracked by https://github.com/dotnet/roslyn/issues/78827 : MQ, Regarding 'acceptOnlyMethods', consider if it would be better to add a special 'LookupOptions' value to filter out properties during lookup
OverloadResolutionResult<PropertySymbol>? propertyResult = arity != 0 || acceptOnlyMethods ? null : resolveProperties(left, lookupResult, binder, ref actualReceiverArguments, ref useSiteInfo);

// 4. determine member kind
Expand Down Expand Up @@ -8686,7 +8686,7 @@ static bool tryResolveExtensionInScope(

// ambiguous between multiple applicable properties
propertyResult.Free();
// Tracked by https://github.com/dotnet/roslyn/issues/76130 : consider using the property overload resolution result in the result to improve reported diagnostics
// Tracked by https://github.com/dotnet/roslyn/issues/78830 : diagnostic quality, consider using the property overload resolution result in the result to improve reported diagnostics
result = makeErrorResult(left.Type, memberName, arity, lookupResult, expression, diagnostics);
return true;
}
Expand Down Expand Up @@ -8816,7 +8816,7 @@ static MethodGroupResolution resolveMethods(

static MethodGroupResolution makeErrorResult(TypeSymbol receiverType, string memberName, int arity, LookupResult lookupResult, SyntaxNode expression, BindingDiagnosticBag diagnostics)
{
// Tracked by https://github.com/dotnet/roslyn/issues/76130 : we'll want to describe what went wrong in a useful way (see OverloadResolutionResult.ReportDiagnostics)
// Tracked by https://github.com/dotnet/roslyn/issues/78830 : diagnostic quality, we'll want to describe what went wrong in a useful way (see OverloadResolutionResult.ReportDiagnostics)
var errorInfo = new CSDiagnosticInfo(ErrorCode.ERR_ExtensionResolutionFailed, receiverType, memberName);
diagnostics.Add(errorInfo, expression.Location);
var resultSymbol = new ExtendedErrorTypeSymbol(containingSymbol: null, lookupResult.Symbols.ToImmutable(), LookupResultKind.OverloadResolutionFailure, errorInfo, arity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2436,7 +2436,6 @@ internal bool InvocableNameofInScope()
#nullable enable
private BoundFunctionPointerInvocation BindFunctionPointerInvocation(SyntaxNode node, BoundExpression boundExpression, AnalyzedArguments analyzedArguments, BindingDiagnosticBag diagnostics)
{
// Tracked by https://github.com/dotnet/roslyn/issues/76130 : this function will probably need an adjustment to deal with static extensions
boundExpression = BindToNaturalType(boundExpression, diagnostics);
RoslynDebug.Assert(boundExpression.Type is FunctionPointerTypeSymbol);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ private static void ReportBadArgumentError(
TMember method,
int arg)
{
// Tracked by https://github.com/dotnet/roslyn/issues/76130 : consider adjusting or removing the argument index for displaying in diagnostic
// Tracked by https://github.com/dotnet/roslyn/issues/78830 : diagnostic quality, consider adjusting or removing the argument index for displaying in diagnostic
BoundExpression argument = arguments.Argument(arg);
if (argument.HasAnyErrors)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public ImmutableArray<int> ToImmutableArray()
private static ImmutableArray<TypeWithAnnotations> GetParameterTypesIncludingReceiver(Symbol symbol)
{
Debug.Assert(symbol.GetIsNewExtensionMember());
// Tracked by https://github.com/dotnet/roslyn/issues/76130 : consider optimizing
// Tracked by https://github.com/dotnet/roslyn/issues/78827 : MQ, consider optimizing
return [symbol.ContainingType.ExtensionParameter.TypeWithAnnotations, .. symbol.GetParameterTypes()];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/Compiler/MethodCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ private void EmitSkeletonMethodInExtension(MethodSymbol methodSymbol)

// Emit methods in extensions as skeletons:
// => throw null;
// Tracked by https://github.com/dotnet/roslyn/issues/76130 : Should we throw NotSupportedException instead?
// Tracked by https://github.com/dotnet/roslyn/issues/76130 : Should throw NotSupportedException instead
builder.EmitOpCode(System.Reflection.Metadata.ILOpCode.Ldnull);
builder.EmitThrow(isRethrow: false);
builder.Realize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private void VerifyExpression(BoundExpression expression, bool overrideSkippedEx
private void VisitForEachEnumeratorInfo(ForEachEnumeratorInfo enumeratorInfo)
{
Visit(enumeratorInfo.DisposeAwaitableInfo);
if (enumeratorInfo.GetEnumeratorInfo.Method.IsExtensionMethod) // Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions
if (enumeratorInfo.GetEnumeratorInfo.Method.IsExtensionMethod) // Tracked by https://github.com/dotnet/roslyn/issues/78828: Test this code path with new extensions
{
foreach (var arg in enumeratorInfo.GetEnumeratorInfo.Arguments)
{
Expand Down
12 changes: 6 additions & 6 deletions src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4510,7 +4510,7 @@ conversionCompletion is not null ?
Debug.Assert(reinferredMethod is object);
if (node.ImplicitReceiverOpt != null)
{
//Debug.Assert(node.ImplicitReceiverOpt.Kind == BoundKind.ObjectOrCollectionValuePlaceholder); // Tracked by https://github.com/dotnet/roslyn/issues/76130 : the receiver may be converted now
//Debug.Assert(node.ImplicitReceiverOpt.Kind == BoundKind.ObjectOrCollectionValuePlaceholder); // Tracked by https://github.com/dotnet/roslyn/issues/78828 : the receiver may be converted now
SetAnalyzedNullability(node.ImplicitReceiverOpt, new VisitResult(node.ImplicitReceiverOpt.Type, NullableAnnotation.NotAnnotated, NullableFlowState.NotNull));
}
SetUnknownResultNullability(node);
Expand Down Expand Up @@ -4559,7 +4559,7 @@ static MethodSymbol addMethodAsMemberOfContainingType(BoundCollectionElementInit
}
else
{
// Tracked by https://github.com/dotnet/roslyn/issues/76130: Do we need to do anything special for new extensions here?
// Tracked by https://github.com/dotnet/roslyn/issues/78828: Do we need to do anything special for new extensions here?
method = (MethodSymbol)AsMemberOfType(containingType, method);
}

Expand Down Expand Up @@ -7441,7 +7441,7 @@ private void ApplyMemberPostConditions(int receiverSlot, MethodSymbol method)
Debug.Assert(receiverSlot >= 0);
if (method.GetIsNewExtensionMember())
{
// Tracked by https://github.com/dotnet/roslyn/issues/76130 : should we extend member post-conditions to work with extension members?
// Tracked by https://github.com/dotnet/roslyn/issues/78828 : should we extend member post-conditions to work with extension members?
return;
}

Expand Down Expand Up @@ -11124,7 +11124,7 @@ private TypeWithAnnotations GetDeclaredParameterResult(ParameterSymbol parameter
var receiverType = VisitRvalueWithState(receiverOpt).Type;
// https://github.com/dotnet/roslyn/issues/30598: Mark receiver as not null
// after indices have been visited, and only if the receiver has not changed.
// Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions
// Tracked by https://github.com/dotnet/roslyn/issues/78829: add support for indexers
_ = CheckPossibleNullReceiver(receiverOpt);

var indexer = node.Indexer;
Expand Down Expand Up @@ -11332,7 +11332,7 @@ private void VisitForEachExpression(

MethodSymbol? reinferredGetEnumeratorMethod = null;

if (enumeratorInfoOpt?.GetEnumeratorInfo is { Method: { IsExtensionMethod: true, Parameters: var parameters } } enumeratorMethodInfo) // Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions
if (enumeratorInfoOpt?.GetEnumeratorInfo is { Method: { IsExtensionMethod: true, Parameters: var parameters } } enumeratorMethodInfo) // Tracked by https://github.com/dotnet/roslyn/issues/78828: Test this code path with new extensions
{
// this is case 7
// We do not need to do this same analysis for non-extension methods because they do not have generic parameters that
Expand Down Expand Up @@ -11399,7 +11399,7 @@ private void VisitForEachExpression(
useLegacyWarnings: false,
AssignmentKind.Assignment);

bool reportedDiagnostic = enumeratorInfoOpt?.GetEnumeratorInfo.Method is { IsExtensionMethod: true } // Tracked by https://github.com/dotnet/roslyn/issues/76130: Test this code path with new extensions
bool reportedDiagnostic = enumeratorInfoOpt?.GetEnumeratorInfo.Method is { IsExtensionMethod: true } // Tracked by https://github.com/dotnet/roslyn/issues/78828: Test this code path with new extensions
? false
: CheckPossibleNullReceiver(expr);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ public PossiblyConditionalState Clone()
case BoundDagPropertyEvaluation e:
{
Debug.Assert(inputSlot > 0);
var property = (PropertySymbol)AsMemberOfType(inputType, e.Property); // Tracked by https://github.com/dotnet/roslyn/issues/76130 : this needs to handle extension properties
var property = (PropertySymbol)AsMemberOfType(inputType, e.Property); // Tracked by https://github.com/dotnet/roslyn/issues/78828 : this needs to handle extension properties
var type = property.TypeWithAnnotations;
var output = new BoundDagTemp(e.Syntax, type.Type, e);
int outputSlot = GetOrCreateSlot(property, inputSlot, forceSlotEvenIfEmpty: true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ protected BoundExpression LowerEvaluation(BoundDagEvaluation evaluation)
PropertySymbol property = p.Property;
var outputTemp = new BoundDagTemp(p.Syntax, property.Type, p);
BoundExpression output = _tempAllocator.GetTemp(outputTemp);
// Tracked by https://github.com/dotnet/roslyn/issues/76130 : Consider preserving the BoundConversion from initial binding instead of using markAsChecked here
// Tracked by https://github.com/dotnet/roslyn/issues/78827 : MQ, Consider preserving the BoundConversion from initial binding instead of using markAsChecked here
input = _localRewriter.ConvertReceiverForExtensionMemberIfNeeded(property, input, markAsChecked: true);
return _factory.AssignmentExpression(output, _localRewriter.MakePropertyAccess(_factory.Syntax, input, property, LookupResultKind.Viable, property.Type, isLeftOfAssignment: false));
}
Expand Down Expand Up @@ -192,7 +192,7 @@ void addArg(RefKind refKind, BoundExpression expression)
addArg(RefKind.Out, _tempAllocator.GetTemp(outputTemp));
}

// Tracked by https://github.com/dotnet/roslyn/issues/76130 : Consider preserving the BoundConversion from initial binding instead of using markAsChecked here
// Tracked by https://github.com/dotnet/roslyn/issues/78827 : MQ, Consider preserving the BoundConversion from initial binding instead of using markAsChecked here
receiver = _localRewriter.ConvertReceiverForExtensionMemberIfNeeded(method, receiver, markAsChecked: true);
return _factory.Call(receiver, method, refKindBuilder.ToImmutableAndFree(), argBuilder.ToImmutableAndFree());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ private BoundStatement InitializeFixedStatementGetPinnable(
callReceiver = initializerExpr;
}

// Tracked by https://github.com/dotnet/roslyn/issues/76130 : Consider preserving the BoundConversion from initial binding instead of using markAsChecked here
// Tracked by https://github.com/dotnet/roslyn/issues/78827 : MQ, Consider preserving the BoundConversion from initial binding instead of using markAsChecked here
// .GetPinnable()
callReceiver = this.ConvertReceiverForExtensionMemberIfNeeded(getPinnableMethod, callReceiver, markAsChecked: true);
var getPinnableCall = getPinnableMethod.IsStatic ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ private BoundExpression MakeObjectInitializerMemberAccess(
_compilation.Conversions.HasImplicitConversionToOrImplementsVarianceCompatibleInterface(rewrittenReceiver.Type, memberSymbol.ContainingType, ref discardedUseSiteInfo, out _));
// It is possible there are use site diagnostics from the above, but none that we need report as we aren't generating code for the conversion
#endif
// Tracked by https://github.com/dotnet/roslyn/issues/76130 : Consider preserving the BoundConversion from initial binding instead of using markAsChecked here
// Tracked by https://github.com/dotnet/roslyn/issues/78827 : MQ, Consider preserving the BoundConversion from initial binding instead of using markAsChecked here
rewrittenReceiver = this.ConvertReceiverForExtensionMemberIfNeeded(memberSymbol, rewrittenReceiver, markAsChecked: true);

switch (memberSymbol.Kind)
Expand Down
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 @@ -4686,7 +4686,7 @@ private SeparatedSyntaxList<ParameterSyntax> ParseParameterList(
allowTrailingSeparator: false,
requireOneElement: forExtension, // For extension declarations, we require at least one receiver parameter
allowSemicolonAsSeparator: false);
// Tracked by https://github.com/dotnet/roslyn/issues/76130 : consider suppressing parsing diagnostics on extension parameters beyond the first one
// Tracked by https://github.com/dotnet/roslyn/issues/78830 : diagnostic quality, consider suppressing parsing diagnostics on extension parameters beyond the first one

_termState = saveTerm;
close = this.EatToken(closeKind);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ internal static ImmutableArray<TypeParameterSymbol> GetTypeParametersIncludingEx

internal static ImmutableArray<ParameterSymbol> GetParametersIncludingExtensionParameter(this Symbol symbol, bool skipExtensionIfStatic)
{
// Tracked by https://github.com/dotnet/roslyn/issues/76130 : consider optimizing
// Tracked by https://github.com/dotnet/roslyn/issues/78827 : MQ, consider optimizing
if (!skipExtensionIfStatic || !symbol.IsStatic)
{
if (symbol.GetIsNewExtensionMember() && symbol.ContainingType.ExtensionParameter is { } extensionParameter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3813,7 +3813,7 @@ private void AddSynthesizedMembers(MembersAndInitializersBuilder builder, Declar
AddSynthesizedTypeMembersIfNecessary(builder, declaredMembersAndInitializers, diagnostics);
AddSynthesizedConstructorsIfNecessary(builder, declaredMembersAndInitializers, diagnostics);

if (TypeKind == TypeKind.Class) // Tracked by https://github.com/dotnet/roslyn/issues/76130 : Consider tightening this check to only top-level non-generic static classes, however optimizing for error scenarios is usually not a goal.
if (TypeKind == TypeKind.Class) // Tracked by https://github.com/dotnet/roslyn/issues/78827 : MQ, Consider tightening this check to only top-level non-generic static classes, however optimizing for error scenarios is usually not a goal.
{
AddSynthesizedExtensionImplementationsIfNecessary(builder, declaredMembersAndInitializers);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,7 @@ private void ValidateIndexerNameAttribute(CSharpAttributeData attribute, Attribu
}
else if (this.GetIsNewExtensionMember() && SourceName != indexerName)
{
// Tracked by https://github.com/dotnet/roslyn/issues/76130 : Report more descriptive error
// Tracked by https://github.com/dotnet/roslyn/issues/78829 : extension indexers, Report more descriptive error
// error CS8078: An expression is too long or complex to compile
diagnostics.Add(ErrorCode.ERR_InsufficientStack, node.ArgumentList.Arguments[0].Location);
}
Expand Down
Loading