- 
                Notifications
    
You must be signed in to change notification settings  - Fork 4.2k
 
Extensions: address or split remaining open issues directly associated with test plan #79452
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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()); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
          
 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't understand the comment.
What dynamic invocation you intend to test?
| 
           Done with review pass (commit 23)  | 
    
          
 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)  | 
    
          
 
 
 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)  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 26)
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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