-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Generic interceptors #68602
Generic interceptors #68602
Conversation
src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs
Outdated
Show resolved
Hide resolved
// gather the type arguments starting from outermost containing type in to the method. | ||
typeArgumentsBuilder.AddRange(stack.Pop().GetMemberTypeArgumentsNoUseSiteDiagnostics()); | ||
} | ||
while (stack.Count != 0); |
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.
Consider using the existing extension method, and also use TypeWithAnnotations
since that type is used for Construct()
.
var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance();
method.ContainingType.GetAllTypeArgumentsNoUseSiteDiagnostics(builder);
builder.AddRange(method.TypeArgumentsWithAnnotations);
interceptor = interceptor.Construct(builder.ToImmutableAndFree());
``` #Resolved
src/Compilers/CSharp/Test/Semantic/Semantics/InterceptorsTests.cs
Outdated
Show resolved
Hide resolved
@jcouv Please take a look when you get the chance. |
src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs
Outdated
Show resolved
Hide resolved
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.
Done with review pass (iteration 2)
src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs
Outdated
Show resolved
Hide resolved
@@ -55,6 +55,8 @@ namespace Microsoft.CodeAnalysis.CSharp.LanguageServer | |||
"CS9159", // ErrorCode.WRN_NullabilityMismatchInParameterTypeOnInterceptor | |||
"CS9160", // ErrorCode.ERR_InterceptorCannotInterceptNameof | |||
"CS9163" // ErrorCode.ERR_SymbolDefinedInAssembly |
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.
Looks like a comma is missing here
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 Thanks (iteration 7) modulo missing comma
Test plan: #67421
Continuation of #68218
Addresses point 1 in #68218 (comment)
It might also be worthwhile to spend a little more time investigating the "unification" approach. But it's something that could be added later without breaking things.