diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs index d134db950a1c5..cd667f65cc525 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs @@ -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. @@ -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? propertyResult = arity != 0 || acceptOnlyMethods ? null : resolveProperties(left, lookupResult, binder, ref actualReceiverArguments, ref useSiteInfo); // 4. determine member kind @@ -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; } @@ -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); diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs index ef11a6d9fb00e..41b580dc6a935 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs @@ -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); diff --git a/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolutionResult.cs b/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolutionResult.cs index 11b36b140651a..e89676d028bc8 100644 --- a/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolutionResult.cs +++ b/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolutionResult.cs @@ -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) { diff --git a/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution_ArgsToParameters.cs b/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution_ArgsToParameters.cs index 5c855f30af32b..2ba7fe42049f9 100644 --- a/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution_ArgsToParameters.cs +++ b/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution_ArgsToParameters.cs @@ -58,7 +58,7 @@ public ImmutableArray ToImmutableArray() private static ImmutableArray 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()]; } diff --git a/src/Compilers/CSharp/Portable/Compiler/MethodCompiler.cs b/src/Compilers/CSharp/Portable/Compiler/MethodCompiler.cs index c4ebcd04da684..ca2eecb8947fa 100644 --- a/src/Compilers/CSharp/Portable/Compiler/MethodCompiler.cs +++ b/src/Compilers/CSharp/Portable/Compiler/MethodCompiler.cs @@ -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(); diff --git a/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.DebugVerifier.cs b/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.DebugVerifier.cs index 9ecb458367894..22612b3c49caf 100644 --- a/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.DebugVerifier.cs +++ b/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.DebugVerifier.cs @@ -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) { diff --git a/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs b/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs index 61f879d6c091f..7be3fd3d3ef48 100644 --- a/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs +++ b/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs @@ -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); @@ -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); } @@ -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; } @@ -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; @@ -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 @@ -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); diff --git a/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker_Patterns.cs b/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker_Patterns.cs index 93a6fe03353e8..7d6f10a9f9482 100644 --- a/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker_Patterns.cs +++ b/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker_Patterns.cs @@ -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); diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter.PatternLocalRewriter.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter.PatternLocalRewriter.cs index 99d4efd16e1c3..883b2081ed2ce 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter.PatternLocalRewriter.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter.PatternLocalRewriter.cs @@ -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)); } @@ -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()); } diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_FixedStatement.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_FixedStatement.cs index ec334729f326c..92102501e78db 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_FixedStatement.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_FixedStatement.cs @@ -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 ? diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_ObjectOrCollectionInitializerExpression.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_ObjectOrCollectionInitializerExpression.cs index ee0fe551e9633..d773ccb44eb24 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_ObjectOrCollectionInitializerExpression.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_ObjectOrCollectionInitializerExpression.cs @@ -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) diff --git a/src/Compilers/CSharp/Portable/Parser/LanguageParser.cs b/src/Compilers/CSharp/Portable/Parser/LanguageParser.cs index 54258d9e0f5c6..03c05482213f6 100644 --- a/src/Compilers/CSharp/Portable/Parser/LanguageParser.cs +++ b/src/Compilers/CSharp/Portable/Parser/LanguageParser.cs @@ -4686,7 +4686,7 @@ private SeparatedSyntaxList 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); diff --git a/src/Compilers/CSharp/Portable/Symbols/MemberSymbolExtensions.cs b/src/Compilers/CSharp/Portable/Symbols/MemberSymbolExtensions.cs index da652b2e03b80..1aa4b38d583e3 100644 --- a/src/Compilers/CSharp/Portable/Symbols/MemberSymbolExtensions.cs +++ b/src/Compilers/CSharp/Portable/Symbols/MemberSymbolExtensions.cs @@ -179,7 +179,7 @@ internal static ImmutableArray GetTypeParametersIncludingEx internal static ImmutableArray 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) diff --git a/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol.cs index 2e8c0b00c8ec1..567bfe7aeb75f 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol.cs @@ -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); } diff --git a/src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertySymbolBase.cs b/src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertySymbolBase.cs index e732124b8f4a3..37b6846086d1d 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertySymbolBase.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertySymbolBase.cs @@ -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); } diff --git a/src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests.cs b/src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests.cs index fe6014cd07d87..fe5a55f555ca3 100644 --- a/src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests.cs +++ b/src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests.cs @@ -2965,7 +2965,7 @@ public static class Extensions var model = comp.GetSemanticModel(tree); var type = tree.GetRoot().DescendantNodes().OfType().Single(); var symbol = model.GetDeclaredSymbol(type); - Assert.True(symbol.ExtensionParameter.HasExplicitDefaultValue); // Tracked by https://github.com/dotnet/roslyn/issues/76130 : consider not recognizing the default value entirely + Assert.True(symbol.ExtensionParameter.HasExplicitDefaultValue); } [Fact] @@ -12825,7 +12825,7 @@ static class E """; try { - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : assertion in NullableWalker + // Tracked by https://github.com/dotnet/roslyn/issues/78828 : assertion in NullableWalker var comp = CreateCompilation(src); CompileAndVerify(comp, expectedOutput: "42").VerifyDiagnostics(); } @@ -16832,7 +16832,7 @@ static class E2 } } """; - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : the diagnostic should describe what went wrong + // Tracked by https://github.com/dotnet/roslyn/issues/78830 : diagnostic quality, the diagnostic should describe what went wrong var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (1,38): error CS9286: 'object' does not contain a definition for 'f' and no accessible extension member 'f' for receiver of type 'object' could be found (are you missing a using directive or an assembly reference?) @@ -19936,7 +19936,7 @@ public static void M() { } interface I2 : I, I { } """; var comp = CreateCompilation(src, targetFramework: TargetFramework.Net70); - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : consider improving the symbols in this error message + // Tracked by https://github.com/dotnet/roslyn/issues/78830 : diagnostic quality, consider improving the symbols in this error message comp.VerifyEmitDiagnostics( // (1,4): error CS0121: The call is ambiguous between the following methods or properties: 'I.M()' and 'I.M()' // I2.M(); @@ -20585,7 +20585,6 @@ static class E } """; var comp = CreateCompilation(src); - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : revisit pattern-based deconstruction comp.VerifyEmitDiagnostics( // (1,6): error CS8130: Cannot infer the type of implicitly-typed deconstruction variable 'x'. // var (x, y) = new C(); @@ -20606,6 +20605,26 @@ static class E var deconstruction = tree.GetRoot().DescendantNodes().OfType().First(); Assert.Null(model.GetDeconstructionInfo(deconstruction).Method); + + src = """ +var (x, y) = new C(); + +class C +{ + public dynamic Deconstruct => throw null; +} +"""; + comp = CreateCompilation(src); + comp.VerifyEmitDiagnostics( + // (1,6): error CS8130: Cannot infer the type of implicitly-typed deconstruction variable 'x'. + // var (x, y) = new C(); + Diagnostic(ErrorCode.ERR_TypeInferenceFailedForImplicitlyTypedDeconstructionVariable, "x").WithArguments("x").WithLocation(1, 6), + // (1,9): error CS8130: Cannot infer the type of implicitly-typed deconstruction variable 'y'. + // var (x, y) = new C(); + Diagnostic(ErrorCode.ERR_TypeInferenceFailedForImplicitlyTypedDeconstructionVariable, "y").WithArguments("y").WithLocation(1, 9), + // (1,14): error CS8129: No suitable 'Deconstruct' instance or extension method was found for type 'C', with 2 out parameters and a void return type. + // var (x, y) = new C(); + Diagnostic(ErrorCode.ERR_MissingDeconstruct, "new C()").WithArguments("C", "2").WithLocation(1, 14)); } [Fact] @@ -21848,7 +21867,7 @@ static class E } } """; - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : revisit when implementing extension indexers + // Tracked by https://github.com/dotnet/roslyn/issues/78829 : revisit when implementing extension indexers var comp = CreateCompilation(src, targetFramework: TargetFramework.Net70); comp.VerifyEmitDiagnostics( // (2,5): error CS0021: Cannot apply indexing with [] to an expression of type 'C' @@ -21990,7 +22009,7 @@ static class E } """; - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : revisit when implementing extension indexers + // Tracked by https://github.com/dotnet/roslyn/issues/78829 : revisit when implementing extension indexers var comp = CreateCompilation(src, targetFramework: TargetFramework.Net70); comp.VerifyEmitDiagnostics( // (2,5): error CS0021: Cannot apply indexing with [] to an expression of type 'C' @@ -22106,7 +22125,7 @@ static class E } """; - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : revisit when implementing extension indexers + // Tracked by https://github.com/dotnet/roslyn/issues/78829 : revisit when implementing extension indexers var comp = CreateCompilation(src, targetFramework: TargetFramework.Net70); comp.VerifyEmitDiagnostics( // (1,16): error CS0021: Cannot apply indexing with [] to an expression of type 'C' @@ -23902,7 +23921,7 @@ static class E Assert.Equal("System.String E.<>E__0.Property { get; }", model.GetSymbolInfo(memberAccess).Symbol.ToTestDisplayString()); } - [Fact(Skip = "Assertion in NullableWalker.AsMemberOfType")] // Tracked by https://github.com/dotnet/roslyn/issues/76130 : Nullability analysis of properties + [Fact(Skip = "Assertion in NullableWalker.AsMemberOfType")] // Tracked by https://github.com/dotnet/roslyn/issues/78828 : Nullability analysis of properties public void Nameof_Instance_Property_Generic_01() { var src = """ @@ -24937,7 +24956,7 @@ T local(T p1) "; var comp = CreateCompilation(src); - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : We might need to add a new warning if we don't want to refer to extension as a type in diagnostics + // Tracked by https://github.com/dotnet/roslyn/issues/78830 : diagnostic quality, we might need to add a new warning if we don't want to refer to extension as a type in diagnostics comp.VerifyEmitDiagnostics( // (11,21): warning CS0693: Type parameter 'T' has the same name as the type parameter from outer type 'Extensions.extension(T[])' @@ -26800,7 +26819,7 @@ public static void M13(object receiver2) {} // public void M1() {} Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "M1").WithArguments("M1", "Extensions").WithLocation(5, 21), - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : The error might be somewhat confusing in this scenario because there are no parameters and we complain about ref-ness of the receiver. + // Tracked by https://github.com/dotnet/roslyn/issues/78830 : diagnostic quality, the error might be somewhat confusing in this scenario because there are no parameters and we complain about ref-ness of the receiver. // (19,21): error CS0663: 'Extensions' cannot define an overloaded method that differs only on parameter modifiers 'in' and 'ref' // public void M3() {} @@ -26928,7 +26947,7 @@ public void M13() {} // public void M1() {} Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "M1").WithArguments("M1", "Extensions").WithLocation(7, 21), - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : The error might be somewhat confusing in this scenario because there are no parameters and we complain about ref-ness of the receiver. + // Tracked by https://github.com/dotnet/roslyn/issues/78830 : diagnostic quality, the error might be somewhat confusing in this scenario because there are no parameters and we complain about ref-ness of the receiver. // (21,21): error CS0663: 'Extensions' cannot define an overloaded method that differs only on parameter modifiers 'in' and 'ref' // public void M3() {} @@ -27862,7 +27881,7 @@ int this[int x] { set{}} "; var comp = CreateCompilation(src); - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : The "within a type" part of the message might be somewhat misleading + // Tracked by https://github.com/dotnet/roslyn/issues/78830 : diagnostic quality, the "within a type" part of the message might be somewhat misleading comp.VerifyDiagnostics( // (8,13): error CS9282: Extension declarations can include only methods or properties // int this[T x] => default; @@ -34283,7 +34302,7 @@ public static class Extensions public C.Enumerator GetEnumerator(int x = 1) => new C.Enumerator(x); } }"; - var verifier = CompileAndVerify(source, expectedOutput: "23", parseOptions: TestOptions.RegularPreview.WithFeature("run-nullable-analysis", "never")); // Tracked by https://github.com/dotnet/roslyn/issues/76130: Nullable analysis asserts + var verifier = CompileAndVerify(source, expectedOutput: "23", parseOptions: TestOptions.RegularPreview.WithFeature("run-nullable-analysis", "never")); // Tracked by https://github.com/dotnet/roslyn/issues/78828: Nullable analysis asserts VerifyFlowGraphAndDiagnosticsForTest((CSharpCompilation)verifier.Compilation, @" @@ -37134,7 +37153,7 @@ public void M() { } } } """; - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : consider reporting a better containing symbol + // Tracked by https://github.com/dotnet/roslyn/issues/78830 : diagnostic quality consider reporting a better containing symbol var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,1): warning CS8604: Possible null reference argument for parameter 'o' in 'extension(object)'. @@ -39811,7 +39830,7 @@ public class MyCollection : IEnumerable IEnumerator IEnumerable.GetEnumerator() => throw null!; } """; - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : missing nullability diagnostic + // Tracked by https://github.com/dotnet/roslyn/issues/78828 : missing nullability diagnostic var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); @@ -39892,7 +39911,7 @@ public int Property { set { } } var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : incorrect nullability + // Tracked by https://github.com/dotnet/roslyn/issues/78828 : incorrect nullability var tree = comp.SyntaxTrees.Single(); var model = comp.GetSemanticModel(tree); var assignment = GetSyntax(tree, "Property = 42"); @@ -39923,7 +39942,7 @@ public T Property { set { } } var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics(); - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : incorrect nullability analysis for object initializer scenario with extension property + // Tracked by https://github.com/dotnet/roslyn/issues/78828 : incorrect nullability analysis for object initializer scenario with extension property var tree = comp.SyntaxTrees.Single(); var model = comp.GetSemanticModel(tree); var assignment = GetSyntax(tree, "Property = oNull"); @@ -40018,7 +40037,7 @@ public int Property { set { } } } """; - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : incorrect nullability analysis for with-expression with extension property (unexpected warning) + // Tracked by https://github.com/dotnet/roslyn/issues/78828 : incorrect nullability analysis for with-expression with extension property (unexpected warning) var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,5): warning CS8602: Dereference of a possibly null reference. @@ -40048,7 +40067,7 @@ public int Property { set { } } } } """; - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : unexpected nullability warning + // Tracked by https://github.com/dotnet/roslyn/issues/78828 : unexpected nullability warning var comp = CreateCompilation(src); comp.VerifyEmitDiagnostics( // (4,5): warning CS8602: Dereference of a possibly null reference. @@ -40933,8 +40952,6 @@ static class E } } """; - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : consider warning (WRN_MissingParamTag) about missing documentation for extension parameter - // since one of the instance members has a tag var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreviewWithDocumentationComments); comp.VerifyEmitDiagnostics( // (8,26): warning CS1572: XML comment has a param tag for 'o', but there is no parameter by that name @@ -40961,8 +40978,6 @@ static class E } } """; - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : consider warning (WRN_MissingParamTag) about missing documentation for member parameter - // since the extension parameter is documented var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreviewWithDocumentationComments); comp.VerifyEmitDiagnostics(); } @@ -41089,8 +41104,6 @@ static class E } } """; - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : consider warning (WRN_MissingTypeParamTag) about missing documentation for extension type parameter - // since one of the members has a tag var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreviewWithDocumentationComments); comp.VerifyEmitDiagnostics( // (8,30): warning CS1711: XML comment has a typeparam tag for 'T', but there is no type parameter by that name @@ -41117,8 +41130,6 @@ static class E } } """; - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : consider warning (WRN_MissingTypeParamTag) about missing documentation for member type parameter - // since the extension type parameter is documented var comp = CreateCompilation(src, parseOptions: TestOptions.RegularPreviewWithDocumentationComments); comp.VerifyEmitDiagnostics(); } diff --git a/src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests2.cs b/src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests2.cs index 18e747b366a86..36fcd66c2d44b 100644 --- a/src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests2.cs +++ b/src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests2.cs @@ -386,7 +386,7 @@ public static class E try { var comp = CreateCompilation([src, OverloadResolutionPriorityAttributeDefinition]); - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : assertion in NullableWalker + // Tracked by https://github.com/dotnet/roslyn/issues/78828 : assertion in NullableWalker CompileAndVerify(comp, expectedOutput: "42").VerifyDiagnostics(); } catch (InvalidOperationException) @@ -2248,7 +2248,7 @@ class C public object? P3 => throw null!; } """; - // Tracked by https://github.com/dotnet/roslyn/issues/76130 : incorrect nullability analysis for property pattern with extension property (unexpected warning) + // Tracked by https://github.com/dotnet/roslyn/issues/78828 : incorrect nullability analysis for property pattern with extension property (unexpected warning) var comp = CreateCompilation(src, targetFramework: TargetFramework.Net90); comp.VerifyEmitDiagnostics( // (4,5): warning CS8602: Dereference of a possibly null reference.