Handle [UnscopedRef] scoped in source and metadata#63134
Merged
cston merged 6 commits intodotnet:mainfrom Aug 22, 2022
Merged
Conversation
7a01abb to
5ed9cde
Compare
15071ad to
66fbae6
Compare
66fbae6 to
939ea72
Compare
cston
reviewed
Aug 5, 2022
| } | ||
|
|
||
| [Fact] | ||
| public void UnscopedScoped() |
Contributor
cston
reviewed
Aug 5, 2022
| var comp = CreateCompilation(new[] { sourceA, UnscopedRefAttributeDefinition }, runtimeFeature: RuntimeFlag.ByRefFields); | ||
| comp.VerifyEmitDiagnostics(); | ||
| var verifier = CompileAndVerify(comp, verify: Verification.Skipped); | ||
| var dump = verifier.Dump(); |
Contributor
cston
reviewed
Aug 5, 2022
| { | ||
| throw null; | ||
| } | ||
| }"; |
Contributor
cston
reviewed
Aug 5, 2022
| } | ||
| public class A<T> | ||
| { | ||
| public ref T F4A([UnscopedRef] scoped ref R<T> r4) // 1 |
Contributor
RikkiGibson
reviewed
Aug 9, 2022
| get | ||
| { | ||
| var scope = DeclaredScope; | ||
| var scope = (RefKind == RefKind.Out && DeclaredScope == DeclarationScope.Unscoped) ? DeclarationScope.RefScoped : DeclaredScope; |
Member
There was a problem hiding this comment.
Does it change behavior to move this logic from ParameterHelpers, etc. into this accessor? Or is it just a refactoring?
Contributor
There was a problem hiding this comment.
The behavior change is described in ParameterSymbol. Basically, DeclaredScope is now just the declared scope, without the implicit scope for various cases. EffectiveScope is still the combined scope.
Contributor
|
dotnet/roslyn-compiler, please review. |
RikkiGibson
approved these changes
Aug 22, 2022
src/Compilers/CSharp/Portable/Symbols/Source/SourceComplexParameterSymbol.cs
Outdated
Show resolved
Hide resolved
333fred
approved these changes
Aug 22, 2022
Member
333fred
left a comment
There was a problem hiding this comment.
LGTM (commit 5), with one test nit.
333fred
approved these changes
Aug 22, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #63070 (metadata scenario)
Fixes #63057 (source scenario)
Relates to test plan #59194