-
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
Avoid giving 'no best type' error when one of the types contains error types #68991
Avoid giving 'no best type' error when one of the types contains error types #68991
Conversation
|
||
public class C { | ||
public void M0() { | ||
Func<bool, int> fn1 = flag => |
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.
Could you also include a lambda scenario without target-type (ie. var fn = ...
)? #Closed
Diagnostic(ErrorCode.ERR_ImplicitlyTypedArrayNoBestType, "new[] { x1, y1 }").WithLocation(5, 18), | ||
// (7,18): error CS0826: No best type found for implicitly-typed array | ||
Diagnostic(ErrorCode.ERR_NoImplicitConv, "x1").WithArguments("C", "Unknown?").WithLocation(5, 26), | ||
// 0.cs(7,30): error CS0029: Cannot implicitly convert type 'C' to 'Unknown?' |
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.
Not blocking this PR: should we also prevent this cascading diagnostic?
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 think that's a good idea. Opening #69138.
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 2) with a question and a test suggestion to consider
Closes #67751
Moving to draft while I build out the test coverage.