Skip to content

Conversation

@jcouv
Copy link
Member

@jcouv jcouv commented Jun 12, 2025

Relates to test plan #76130

@jcouv jcouv self-assigned this Jun 12, 2025
@jcouv jcouv added the Feature - Extension Everything The extension everything feature label Jun 12, 2025
@jcouv jcouv force-pushed the extensions-langver2 branch from 223609d to dde645c Compare June 13, 2025 04:27
@jcouv jcouv force-pushed the extensions-langver2 branch from dde645c to 4839b84 Compare June 13, 2025 05:45
}

// This is what BindInvocationExpressionContinued is doing in terms of reporting diagnostics and detecting a failure
static bool bindInvocationExpressionContinued(
Copy link
Contributor

@AlekseyTs AlekseyTs Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bindInvocationExpressionContinued

It is not clear why this local function is removed. As the comment states, it is supposed to do what BindInvocationExpressionContinued would do. It looks like BindInvocationExpressionContinued is still there and didn't even change. #Closed

Copy link
Member Author

@jcouv jcouv Jun 13, 2025

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

Copy link
Contributor

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.

@jcouv jcouv marked this pull request as ready for review June 13, 2025 18:30
@jcouv jcouv requested a review from a team as a code owner June 13, 2025 18:31

ReportDiagnosticsIfObsolete(diagnostics, method, node, hasBaseReceiver: false);
ReportDiagnosticsIfUnmanagedCallersOnly(diagnostics, method, node, isDelegateConversion: false);
Debug.Assert(!IsDisallowedExtensionInOlderLangVer(method));
Copy link
Contributor

@AlekseyTs AlekseyTs Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug.Assert(!IsDisallowedExtensionInOlderLangVer(method));

I suggest reverting this change in order to avoid unnecessary merge conflicts. This code path is specific to operators and operators are handled in a feature branch. BTW, operators must always be reported, the assert is misleading. #Closed


ReportDiagnosticsIfObsolete(diagnostics, method, node, hasBaseReceiver: false);
ReportDiagnosticsIfUnmanagedCallersOnly(diagnostics, method, node, isDelegateConversion: false);
Debug.Assert(!IsDisallowedExtensionInOlderLangVer(method));
Copy link
Contributor

@AlekseyTs AlekseyTs Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug.Assert(!IsDisallowedExtensionInOlderLangVer(method));

Same comment as above. #Closed


internal static bool IsDisallowedExtensionInOlderLangVer(MethodSymbol symbol)
{
return symbol.GetIsNewExtensionMember() && symbol.IsStatic;
Copy link
Contributor

@AlekseyTs AlekseyTs Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

symbol.GetIsNewExtensionMember() && symbol.IsStatic;

It feels like the condition is somewhat inaccurate. Instance ordinary methods are allowed, other kinds of methods are disallowed. #Closed

Copy link
Member Author

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();
Copy link
Contributor

@AlekseyTs AlekseyTs Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comp.VerifyEmitDiagnostics();

Consider doing the same verification as we do for Preview version above. #Closed

comp.VerifyEmitDiagnostics();

comp = CreateCompilation(src, references: [libRef], parseOptions: TestOptions.RegularNext);
comp.VerifyEmitDiagnostics();
Copy link
Contributor

@AlekseyTs AlekseyTs Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comp.VerifyEmitDiagnostics();

Same suggestion #Closed

Diagnostic(ErrorCode.ERR_FeatureInPreview, "Property").WithArguments("extensions").WithLocation(2, 12));

comp = CreateCompilation(src, references: [libRef], parseOptions: TestOptions.RegularNext);
comp.VerifyEmitDiagnostics();
Copy link
Contributor

@AlekseyTs AlekseyTs Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comp.VerifyEmitDiagnostics();

CompileAndVerify(comp, expectedOutput: "property").VerifyDiagnostics();? #Closed

Diagnostic(ErrorCode.ERR_FeatureInPreview, "Property").WithArguments("extensions").WithLocation(1, 15));

comp = CreateCompilation(src, references: [libRef], parseOptions: TestOptions.RegularNext);
comp.VerifyEmitDiagnostics();
Copy link
Contributor

@AlekseyTs AlekseyTs Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comp.VerifyEmitDiagnostics();

CompileAndVerify(comp, expectedOutput: "property").VerifyDiagnostics(); #Closed

Diagnostic(ErrorCode.ERR_FeatureInPreview, "Property").WithArguments("extensions").WithLocation(1, 20));

comp = CreateCompilation(src, references: [libRef], parseOptions: TestOptions.RegularNext);
comp.VerifyEmitDiagnostics();
Copy link
Contributor

@AlekseyTs AlekseyTs Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comp.VerifyEmitDiagnostics();

CompileAndVerify(comp, expectedOutput: "property").VerifyDiagnostics();? #Closed

@AlekseyTs
Copy link
Contributor

Done with review pass (commit 2)

Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (commit 4)

@jcouv jcouv merged commit d9a48df into dotnet:main Jun 17, 2025
24 checks passed
@jcouv jcouv deleted the extensions-langver2 branch June 17, 2025 16:53
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Jun 17, 2025
CyrusNajmabadi added a commit to CyrusNajmabadi/roslyn that referenced this pull request Jun 18, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Compilers Feature - Extension Everything The extension everything feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants