-
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
Fix overload resolution regression around params parameters #73373
Conversation
@@ -2261,11 +2245,9 @@ private static ParameterSymbol GetParameter(int argIndex, MemberAnalysisResult r | |||
continue; | |||
} | |||
|
|||
var parameter1 = GetParameter(i, m1.Result, m1Original); | |||
uninst1.Add(GetParameterType(parameter1, m1.Result, m1Original.Length)); | |||
uninst1.Add(getParameterTypeAndRefKind(i, m1.Result, m1DefinitionParameters, m1.Result.DefinitionParamsElementTypeOpt, out _)); |
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.
|
||
var parameter2 = GetParameter(i, m2.Result, m2Original); | ||
uninst2.Add(GetParameterType(parameter2, m2.Result, m2Original.Length)); | ||
uninst2.Add(getParameterTypeAndRefKind(i, m2.Result, m2DefinitionParameters, m2.Result.DefinitionParamsElementTypeOpt, out _)); |
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.
public class Foo | ||
{ | ||
public void Method<S>(params Func<Bar, S>[] projections) => Console.Write(1); | ||
public void Method<S>(params Func<Bar, Wrapper<S>>[] projections) => Console.Write(2); |
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.
@RikkiGibson, @333fred, @dotnet/roslyn-compiler For the second review |
1 similar comment
@RikkiGibson, @333fred, @dotnet/roslyn-compiler For the second review |
{ | ||
public class C | ||
{ | ||
public void Method<S>(params Func<Bar, S>[] projections) => Console.Write(1); |
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 also testing a "params collections" scenario such as params IEnumerable<Func<Bar, S>>
versus params IEnumerable<Func<Bar, Wrapper<S>>>
#Resolved
We'd please need some kind of workaround because the bug has found its way into 8.0.300, the stable Visual studio, the preview of Visual Studio anyway, uninstalling 8.0.300 won't do, uninstalling 9.x-preview won't do, fixating 8.0.204 in global.json and disallowing rollforward won't do. |
As a temporary workaround you could try installing |
Fixes #73346.