Extensions: address or split remaining open issues directly associated with test plan - #79452
Conversation
b7c6cd8 to
7312e4f
Compare
e86b2f1 to
e4260cc
Compare
e4260cc to
e62a6e7
Compare
📝 See MakeDeconstructInvocationExpression line 661 #Closed Refers to: src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests.cs:24200 in 8d46bd8. [](commit_id = 8d46bd8, deletion_comment = True) |
| continue; | ||
| } | ||
|
|
||
| // Note: we only care about methods since we're already decided this is a method group (ie. not resolving to some other kind of extension member) |
There was a problem hiding this comment.
- that's the behavior we have chosen for determining unique signature in newer LangVer (see
GetUniqueSignatureFromMethodGroupline 11090 below) - that's consistent with how lookup works in general (we work up inheritance chain and if we get a method first, we'll keep looking at other methods to complete the method group, ignoring non-methods)
There was a problem hiding this comment.
Maybe I misunderstood the question. If we get here, the caller is asking what is the function type of this method group.
There was a problem hiding this comment.
Perhaps it would be clearer to say that we decided that we want to extract signature from candidate methods. The term "method group" is somewhat confusing with respect to extensions, since it can resolve to a non-method.
| Assert.Equal(SymbolKind.Parameter, symbol.Kind); | ||
| Assert.Equal("System.Int32 i", symbol.ToTestDisplayString()); | ||
|
|
||
| Assert.Equal("E", model.GetEnclosingSymbol(extensionParameter.SpanStart).ToTestDisplayString()); |
The reason behind removal of this comment is not obvious #Closed Refers to: src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests.cs:24200 in 8d46bd8. [](commit_id = 8d46bd8, deletion_comment = True) |
| } | ||
| else if (typeKind == TypeKind.Extension) | ||
| { | ||
| _ = compilation.GetSpecialType(SpecialType.System_Object); |
There was a problem hiding this comment.
It's meant to produce a diagnostic, but doesn't... Fixed,, added test and stepped through. Thanks
| Debug.Assert(((Cci.ITypeReference)this).AsTypeDefinition(context) != null); | ||
| NamedTypeSymbol baseType = AdaptedNamedTypeSymbol.BaseTypeNoUseSiteDiagnostics; | ||
|
|
||
| if (AdaptedNamedTypeSymbol.IsScriptClass || AdaptedNamedTypeSymbol.IsExtension) // Tracked by https://github.com/dotnet/roslyn/issues/76130 : we should have checked the presence of System.Object |
There was a problem hiding this comment.
// Tracked by #76130 : we should have checked the presence of System.Object
I would expect to see a test added. #Closed
| } | ||
|
|
||
| [Fact] | ||
| public void Dynamic_07() |
There was a problem hiding this comment.
I didn't understand the comment. In Dynamic_07 the parameter of the local function is dynamic and the invocation uses runtime binder. Each of these tests goes through LocalRewriter.VisitDynamicInvocation
There was a problem hiding this comment.
I didn't understand the comment.
What dynamic invocation you intend to test?
commented
Jul 21, 2025
|
Done with review pass (commit 23) |
commented
Jul 21, 2025
Just to confirm, did you see the comment I'd left? 📝 See MakeDeconstructInvocationExpression line 661 In reply to: 3096811863 Refers to: src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests.cs:24200 in 8d46bd8. [](commit_id = 8d46bd8, deletion_comment = True) |
commented
Jul 22, 2025
What am I supposed to see there? In reply to: 3097572916 Refers to: src/Compilers/CSharp/Test/Emit3/Semantics/ExtensionTests.cs:24200 in 8d46bd8. [](commit_id = 8d46bd8, deletion_comment = True) |
| comp = CreateCompilation(src, references: [libRef], parseOptions: TestOptions.Regular13); | ||
| CompileAndVerify(comp, expectedOutput: "ran").VerifyDiagnostics(unnecessaryDirective); | ||
|
|
||
| if (!CompilationExtensions.EnableVerifyUsedAssemblies) // Tracked by https://github.com/dotnet/roslyn/issues/78968 |
There was a problem hiding this comment.
@AlekseyTs FYI, the used assemblies leg hit an issue in VerifyUsedAssemblyReferences (line 1843, reporting an unexpected diagnostic that namespace N cannot be found when the set of referenced assemblies is shrunk).
The strange thing is that VerifyDiagnostics doesn't complain about unnecessary using but GetUsedAssemblyReferences() doesn't report the assembly containing namespace N as used.
I will investigate in a follow-up.
Removes remaining references to test plan #76130
Closes #77933
This is best reviewed commit by commit.
Corresponding spec update: dotnet/csharplang#9535