-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Extensions: allow extern and disallow in nameof #79021
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
Changes from 3 commits
5f27903
062e9d3
c24df97
50c71c2
ae9bf3b
5952ab7
ba7d712
75073e3
7c1b97a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -395,7 +395,7 @@ bool Cci.IMethodDefinition.IsExternal | |
| { | ||
| CheckDefinitionInvariant(); | ||
|
|
||
| return AdaptedMethodSymbol.IsExternal; | ||
| return !AdaptedMethodSymbol.ContainingType.IsExtension && AdaptedMethodSymbol.IsExternal; | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -422,7 +422,7 @@ bool Cci.IMethodDefinition.IsPlatformInvoke | |
| get | ||
| { | ||
| CheckDefinitionInvariant(); | ||
| return AdaptedMethodSymbol.GetDllImportData() != null; | ||
| return !AdaptedMethodSymbol.ContainingType.IsExtension && AdaptedMethodSymbol.GetDllImportData() != null; | ||
| } | ||
| } | ||
| #nullable disable | ||
|
|
@@ -431,7 +431,7 @@ Cci.IPlatformInvokeInformation Cci.IMethodDefinition.PlatformInvokeData | |
| get | ||
| { | ||
| CheckDefinitionInvariant(); | ||
| return AdaptedMethodSymbol.GetDllImportData(); | ||
| return AdaptedMethodSymbol.ContainingType.IsExtension ? null : AdaptedMethodSymbol.GetDllImportData(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to adjust GetImplementationAttributes similarly? #Resolved |
||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,8 +22,6 @@ public SourceExtensionImplementationMethodSymbol(MethodSymbol sourceMethod) | |
| { | ||
| Debug.Assert(sourceMethod.GetIsNewExtensionMember()); | ||
| Debug.Assert(sourceMethod.IsStatic || sourceMethod.ContainingType.ExtensionParameter is not null); | ||
| Debug.Assert(!sourceMethod.IsExtern); | ||
| Debug.Assert(!sourceMethod.IsExternal); | ||
|
|
||
| // Tracked by https://github.com/dotnet/roslyn/issues/78963 : Are we creating type parameters with the right emit behavior? Attributes, etc. | ||
| // Also, they should be IsImplicitlyDeclared | ||
|
|
@@ -59,9 +57,9 @@ internal override int ParameterCount | |
|
|
||
| internal sealed override bool IsAccessCheckedOnOverride => false; | ||
|
|
||
| public sealed override bool IsExtern => false; | ||
| public sealed override DllImportData? GetDllImportData() => null; | ||
| internal sealed override bool IsExternal => false; | ||
| public sealed override bool IsExtern => _originalMethod.IsExtern; | ||
| public sealed override DllImportData? GetDllImportData() => _originalMethod.GetDllImportData(); | ||
| internal sealed override bool IsExternal => _originalMethod.IsExternal; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we just delete these since the base class WrappedMethodSymbol already has this implementation? #Resolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've been leaning toward abstract+sealed design (pushing implementations down into leaves) so I intentionally left those despite the base/virtual implementation being sufficient |
||
|
|
||
| internal sealed override bool IsDeclaredReadOnly => false; | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
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.
"members" (plural) or "
areis allowed"? #Resolved