-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Extensions: bind unconditionally of LangVer #78947
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
223609d to
dde645c
Compare
dde645c to
4839b84
Compare
| } | ||
|
|
||
| // This is what BindInvocationExpressionContinued is doing in terms of reporting diagnostics and detecting a failure | ||
| static bool bindInvocationExpressionContinued( |
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.
The local function was removed because the second half of the code is unreachable. We only have one caller for the local function and we always get here with !result.Succeeded. I'll file an issue to follow-up on this instead, as to not impact extensions progress.
Filled #78954
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 is fine to adjust the body, but it was an intent to have the local function not for the purpose of code reuse, but for the purpose to make it easier to keep two different code paths in sync.
|
|
||
| ReportDiagnosticsIfObsolete(diagnostics, method, node, hasBaseReceiver: false); | ||
| ReportDiagnosticsIfUnmanagedCallersOnly(diagnostics, method, node, isDelegateConversion: false); | ||
| Debug.Assert(!IsDisallowedExtensionInOlderLangVer(method)); |
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.
|
|
||
| ReportDiagnosticsIfObsolete(diagnostics, method, node, hasBaseReceiver: false); | ||
| ReportDiagnosticsIfUnmanagedCallersOnly(diagnostics, method, node, isDelegateConversion: false); | ||
| Debug.Assert(!IsDisallowedExtensionInOlderLangVer(method)); |
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.
|
|
||
| internal static bool IsDisallowedExtensionInOlderLangVer(MethodSymbol symbol) | ||
| { | ||
| return symbol.GetIsNewExtensionMember() && symbol.IsStatic; |
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'm reluctant to add logic that can't be exercised in this branch, but if it'll make the merge easier, seems reasonable
| CompileAndVerify(comp, expectedOutput: "(42, 43)").VerifyDiagnostics(); | ||
|
|
||
| comp = CreateCompilation(src, references: [libRef], parseOptions: TestOptions.Regular13); | ||
| comp.VerifyEmitDiagnostics(); |
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.
| comp.VerifyEmitDiagnostics(); | ||
|
|
||
| comp = CreateCompilation(src, references: [libRef], parseOptions: TestOptions.RegularNext); | ||
| comp.VerifyEmitDiagnostics(); |
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.
| Diagnostic(ErrorCode.ERR_FeatureInPreview, "Property").WithArguments("extensions").WithLocation(2, 12)); | ||
|
|
||
| comp = CreateCompilation(src, references: [libRef], parseOptions: TestOptions.RegularNext); | ||
| comp.VerifyEmitDiagnostics(); |
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.
| Diagnostic(ErrorCode.ERR_FeatureInPreview, "Property").WithArguments("extensions").WithLocation(1, 15)); | ||
|
|
||
| comp = CreateCompilation(src, references: [libRef], parseOptions: TestOptions.RegularNext); | ||
| comp.VerifyEmitDiagnostics(); |
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.
| Diagnostic(ErrorCode.ERR_FeatureInPreview, "Property").WithArguments("extensions").WithLocation(1, 20)); | ||
|
|
||
| comp = CreateCompilation(src, references: [libRef], parseOptions: TestOptions.RegularNext); | ||
| comp.VerifyEmitDiagnostics(); |
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 (commit 2) |
AlekseyTs
left a comment
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 4)
Fix more Update versions Fix more In progress Flip Fix Fix remove wrapper Fix Fix in progress Fix DeclarationKind layering fix One building In progress Breaking out refactoring helpers into core api vs service VB side In progress Move type workaround Update src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensions.projitems Fix SubText ctor parameter verification. (dotnet#78989) * Fix SubText ctor parameter verification. This ctor currently throws given a zero length span at the end (and only the end) of the subtext. This evidently became far more prevalent with this (fairly) recent change to optimize newline information in our sourcetext classes. (dotnet#74728) It doesn't make to allow zero length spans at all locations but at the end of the subtext, so the fix is just to allow construction in that case too. Big props to Manish Vasani for providing a very actionable repro for this. Fixes dotnet#78985. Note there is a potentially related issue outlined in dotnet#76225 that looks attributable to the PR above too. It possible that this addresses that issue too, but I'm not completely convinced. Extensions: bind unconditionally of LangVer (dotnet#78947) Extensions: use specific tracking issues for different areas (second pass) (dotnet#78971) Fix nullable analysis involving extensions and collection expressions (dotnet#78926) Update src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/CSharpCompilerExtensions.projitems in progrss Update src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CompilerExtensions.projitems Update src/Workspaces/SharedUtilitiesAndExtensions/Compiler/VisualBasic/VisualBasicCompilerExtensions.projitems extensions Fix RootNamespace Fixes Fixes IN progress in progress
This reverts commit d9a48df.
Relates to test plan #76130