209 references to ScopedKind
GenerateDocumentationAndConfigFiles (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationParameterSymbol.cs (2)
62public ScopedKind ScopedKind => ScopedKind.None;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxGeneratorInternalExtensions\SyntaxGeneratorInternal.cs (2)
113=> symbol is { RefKind: RefKind.Ref or RefKind.In or RefKind.RefReadOnlyParameter, ScopedKind: ScopedKind.ScopedRef } 114or { RefKind: RefKind.None, Type.IsRefLikeType: true, ScopedKind: ScopedKind.ScopedValue };
Microsoft.CodeAnalysis (2)
Symbols\ILocalSymbol.cs (1)
46ScopedKind ScopedKind { get; }
Symbols\IParameterSymbol.cs (1)
28ScopedKind ScopedKind { get; }
Microsoft.CodeAnalysis.Analyzers (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationParameterSymbol.cs (2)
62public ScopedKind ScopedKind => ScopedKind.None;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxGeneratorInternalExtensions\SyntaxGeneratorInternal.cs (2)
113=> symbol is { RefKind: RefKind.Ref or RefKind.In or RefKind.RefReadOnlyParameter, ScopedKind: ScopedKind.ScopedRef } 114or { RefKind: RefKind.None, Type.IsRefLikeType: true, ScopedKind: ScopedKind.ScopedValue };
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationParameterSymbol.cs (2)
62public ScopedKind ScopedKind => ScopedKind.None;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxGeneratorInternalExtensions\SyntaxGeneratorInternal.cs (2)
113=> symbol is { RefKind: RefKind.Ref or RefKind.In or RefKind.RefReadOnlyParameter, ScopedKind: ScopedKind.ScopedRef } 114or { RefKind: RefKind.None, Type.IsRefLikeType: true, ScopedKind: ScopedKind.ScopedValue };
Microsoft.CodeAnalysis.CSharp (173)
Binder\Binder.QueryUnboundLambdaState.cs (2)
51public override ScopedKind DeclaredScope(int index) => ScopedKind.None;
Binder\Binder.ValueChecks.cs (8)
1529{ EffectiveScope: ScopedKind.ScopedValue } => SafeContext.CurrentMethod, 1543{ EffectiveScope: ScopedKind.ScopedRef } => SafeContext.CurrentMethod, 1576var isRefScoped = parameterSymbol.EffectiveScope == ScopedKind.ScopedRef; 3428internal override ScopedKind DeclaredScope => throw ExceptionUtilities.Unreachable(); 3430internal override ScopedKind EffectiveScope 3436return ScopedKind.None; 3441return ScopedKind.None; 3446return ScopedKind.ScopedRef;
Binder\Binder_AnonymousTypes.cs (1)
97ScopedKind.None);
Binder\Binder_Deconstruct.cs (1)
902localSymbol.Scope == ScopedKind.ScopedValue && !declTypeWithAnnotations.Type.IsErrorOrRefLikeOrAllowsRefLikeType())
Binder\Binder_Expressions.cs (6)
3312if (localSymbol.Scope == ScopedKind.ScopedValue && !declType.Type.IsErrorOrRefLikeOrAllowsRefLikeType()) 11490ImmutableArray<ScopedKind>? parameterScopesOverride = null, 11501(parameters.Any(p => p.EffectiveScope != ScopedKind.None) ? parameters.SelectAsArray(p => p.EffectiveScope) : default); 11534(parameterScopes.IsDefault || parameterScopes.All(scope => scope == ScopedKind.None)) && 11568parameterScopes.IsDefault ? ScopedKind.None : parameterScopes[i], 11573fieldsBuilder.Add(new AnonymousTypeField(name: "", location, returnType, returnRefKind, ScopedKind.None));
Binder\Binder_Lambda.cs (4)
48ImmutableArray<ScopedKind> scopes = default; 130var scopesBuilder = ArrayBuilder<ScopedKind>.GetInstance(); 182var refKind = ParameterHelpers.GetModifiers(p.Modifiers, ignoreParams: false, out _, out var paramsKeyword, out _, out var scope); 227if (scopesBuilder.Any(s => s != ScopedKind.None))
Binder\Binder_Query.cs (1)
823new AnonymousTypeField(fieldName, fieldValue.Syntax.Location, TypeWithAnnotations.Create(TypeOrError(fieldValue)), RefKind.None, ScopedKind.None);
Binder\Binder_Statements.cs (1)
1106if (localSymbol.Scope == ScopedKind.ScopedValue && !declTypeOpt.Type.IsErrorOrRefLikeOrAllowsRefLikeType())
Binder\ForEachLoopBinder.cs (1)
328if (local.Scope == ScopedKind.ScopedValue && !declType.Type.IsErrorOrRefLikeOrAllowsRefLikeType())
Binder\RefSafetyAnalysis.cs (7)
508var scopedModifier = _useUpdatedEscapeRules ? local.Scope : ScopedKind.None; 509if (scopedModifier != ScopedKind.None) 511refEscapeScope = scopedModifier == ScopedKind.ScopedRef ? 514valEscapeScope = scopedModifier == ScopedKind.ScopedValue ? 549if (_useUpdatedEscapeRules && localSymbol.Scope != ScopedKind.None) 674tryGetReceiverParameter(m)?.EffectiveScope == ScopedKind.None)
BoundTree\UnboundLambda.cs (18)
415ImmutableArray<ScopedKind> declaredScopes, 506public ScopedKind DeclaredScope(int index) { return Data.DeclaredScope(index); } 603public abstract ScopedKind DeclaredScope(int index); 690internal (ImmutableArray<RefKind>, ArrayBuilder<ScopedKind>, ImmutableArray<TypeWithAnnotations>, bool) CollectParameterProperties() 693var parameterScopesBuilder = ArrayBuilder<ScopedKind>.GetInstance(ParameterCount); 700var scope = DeclaredScope(i); 703if (scope == ScopedKind.None) 707scope = ScopedKind.ScopedRef; 715scope = ScopedKind.ScopedValue; 722else if (scope == ScopedKind.ScopedValue && _unboundLambda.ParameterAttributes(i).Any()) 788if (((DeclaredScope(i) == ScopedKind.None && parameterScopesBuilder[i] == ScopedKind.ScopedRef) || 789DeclaredScope(i) == ScopedKind.ScopedValue || parameterScopesBuilder[i] == ScopedKind.ScopedValue) && 1504private readonly ImmutableArray<ScopedKind> _parameterDeclaredScopes; 1520ImmutableArray<ScopedKind> parameterDeclaredScopes, 1612public override ScopedKind DeclaredScope(int index) 1615return _parameterDeclaredScopes.IsDefault ? ScopedKind.None : _parameterDeclaredScopes[index];
BoundTree\VariablePendingInference.cs (1)
67if (localSymbol.Scope == ScopedKind.ScopedValue && !type.Type.IsErrorOrRefLikeOrAllowsRefLikeType())
CodeGen\CodeGenerator_RefSafety.cs (2)
97if (parameter.Type.IsRefLikeOrAllowsRefLikeType() && parameter.EffectiveScope != ScopedKind.ScopedValue) 105else if (parameter.RefKind != RefKind.None && parameter.EffectiveScope == ScopedKind.None)
CodeGen\Optimizer.cs (2)
2492internal override ScopedKind Scope => ScopedKind.None;
Compilation\CSharpCompilation.cs (1)
4428fields.Add(new AnonymousTypeField(name, location, TypeWithAnnotations.Create(type, nullableAnnotation), RefKind.None, ScopedKind.None));
Emitter\Model\PEModuleBuilder.cs (3)
1846internal SynthesizedAttributeData SynthesizeScopedRefAttribute(ParameterSymbol symbol, ScopedKind scope) 1848Debug.Assert(scope != ScopedKind.None); 1849Debug.Assert(!ParameterHelpers.IsRefScopedByDefault(symbol) || scope == ScopedKind.ScopedValue);
FlowAnalysis\NullableWalker.PlaceholderLocal.cs (2)
73internal override ScopedKind Scope => ScopedKind.None;
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
236(!builder.ReturnType.IsRefLikeType || parameter.EffectiveScope == ScopedKind.ScopedValue))
SymbolDisplay\SymbolDisplayVisitor.cs (2)
245if (symbol.ScopedKind == ScopedKind.ScopedRef) 260else if (symbol.ScopedKind == ScopedKind.ScopedValue)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (2)
851if (symbol.ScopedKind == ScopedKind.ScopedRef && 872if (symbol.ScopedKind == ScopedKind.ScopedValue &&
Symbols\AnonymousTypes\AnonymousTypeField.cs (2)
25public readonly ScopedKind Scope; 41ScopedKind scope,
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (2)
317(ScopedKind.None, false) => true, 318(ScopedKind.ScopedRef, true) => true,
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (1)
61new SynthesizedDelegateInvokeMethod.ParameterDescription(TypeWithAnnotations.Create(typeParams[i]), refKinds.IsNull ? RefKind.None : refKinds[i], ScopedKind.None, defaultValue: null, isParams: false, hasUnscopedRefAttribute: false));
Symbols\FunctionPointers\FunctionPointerParameterSymbol.cs (4)
33internal override ScopedKind DeclaredScope => throw ExceptionUtilities.Unreachable(); 35internal override ScopedKind EffectiveScope 36=> ParameterHelpers.IsRefScopedByDefault(this) ? ScopedKind.ScopedRef : ScopedKind.None;
Symbols\LocalSymbol.cs (1)
207internal abstract ScopedKind Scope { get; }
Symbols\Metadata\PE\PEParameterSymbol.cs (12)
84public ScopedKind Scope 86get { return (ScopedKind)((_bits >> ScopeOffset) & ScopeMask); } 101Debug.Assert(EnumUtilities.ContainsAllValues<ScopedKind>(ScopeMask)); 105public PackedFlags(RefKind refKind, bool attributesAreComplete, bool hasNameInMetadata, ScopedKind scope, bool hasUnscopedRefAttribute) 260ScopedKind scope = ScopedKind.None; 328scope = ScopedKind.None; 335scope = ScopedKind.ScopedRef; 339scope = ScopedKind.ScopedValue; 348scope = ScopedKind.ScopedRef; 1083internal sealed override ScopedKind DeclaredScope => throw ExceptionUtilities.Unreachable(); 1085internal sealed override ScopedKind EffectiveScope => _packedFlags.Scope;
Symbols\ParameterSymbol.cs (2)
442internal abstract ScopedKind EffectiveScope { get; } 447internal abstract ScopedKind DeclaredScope { get; }
Symbols\PublicModel\LocalSymbol.cs (1)
54ScopedKind ILocalSymbol.ScopedKind => _underlying.Scope;
Symbols\PublicModel\ParameterSymbol.cs (1)
61ScopedKind IParameterSymbol.ScopedKind => _underlying.EffectiveScope;
Symbols\SignatureOnlyParameterSymbol.cs (4)
58internal override ScopedKind DeclaredScope => throw ExceptionUtilities.Unreachable(); 60internal override ScopedKind EffectiveScope 61=> ParameterHelpers.IsRefScopedByDefault(this) ? ScopedKind.ScopedRef : ScopedKind.None;
Symbols\Source\LambdaParameterSymbol.cs (1)
24ScopedKind scope,
Symbols\Source\LambdaSymbol.cs (1)
365var scope = unboundLambda.DeclaredScope(p);
Symbols\Source\ParameterHelpers.cs (14)
44ScopedKind scope, 73ScopedKind scope, 136ScopedKind scope, 177Func<Binder, TOwningSymbol, TypeWithAnnotations, TParameterSyntax, RefKind, int, SyntaxToken, SyntaxToken, bool, ScopedKind, BindingDiagnosticBag, TParameterSymbol> parameterCreationFunc, 257Func<Binder, TOwningSymbol, TypeWithAnnotations, TParameterSyntax, RefKind, int, SyntaxToken, SyntaxToken, bool, ScopedKind, BindingDiagnosticBag, TParameterSymbol> parameterCreationFunc, 269var refKind = GetModifiers(parameterSyntax.Modifiers, ignoreParams: inExtension, out SyntaxToken refnessKeyword, out SyntaxToken paramsKeyword, out SyntaxToken thisKeyword, out ScopedKind scope); 321Debug.Assert(parameter is SourceComplexParameterSymbolBase || parameter is not SourceParameterSymbol s || s.DeclaredScope == ScopedKind.None); // Only SourceComplexParameterSymbolBase validates 'scope'. 435var scope = parameter.EffectiveScope; 436if (scope == ScopedKind.None) 442return scope == ScopedKind.ScopedValue; 1143internal static RefKind GetModifiers(SyntaxTokenList modifiers, bool ignoreParams, out SyntaxToken refnessKeyword, out SyntaxToken paramsKeyword, out SyntaxToken thisKeyword, out ScopedKind scope) 1200scope = (refKind == RefKind.None) ? ScopedKind.ScopedValue : ScopedKind.ScopedRef; 1204scope = ScopedKind.None;
Symbols\Source\SourceClonedParameterSymbol.cs (2)
66internal sealed override ScopedKind DeclaredScope => _originalParam.DeclaredScope; 68internal sealed override ScopedKind EffectiveScope => _originalParam.EffectiveScope;
Symbols\Source\SourceComplexParameterSymbol.cs (9)
53ScopedKind scope) 212internal sealed override ScopedKind EffectiveScope 216var scope = CalculateEffectiveScopeIgnoringAttributes(); 217if (scope != ScopedKind.None && 221return ScopedKind.None; 901else if (DeclaredScope != ScopedKind.None) 1601if (DeclaredScope == ScopedKind.ScopedValue && !Type.IsErrorOrRefLikeOrAllowsRefLikeType()) 1770ScopedKind scope) 1797ScopedKind scope)
Symbols\Source\SourceLocalSymbol.cs (6)
35private readonly ScopedKind _scope; 101? isScoped ? ScopedKind.ScopedRef : ScopedKind.None 102: isScoped ? ScopedKind.ScopedValue : ScopedKind.None; 120internal sealed override ScopedKind Scope => _scope;
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (5)
1427p is { EffectiveScope: ScopedKind.None, RefKind: RefKind.Ref } or { EffectiveScope: ScopedKind.ScopedRef, RefKind: RefKind.Out } && 1517ScopedKind baseScope, 1519ScopedKind overrideScope, 1530return allowVariance && baseScope == ScopedKind.None;
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (1)
397if (extensionParameter.DeclaredScope != ScopedKind.None)
Symbols\Source\SourceParameterSymbol.cs (11)
27private readonly ScopedKind _scope; 41ScopedKind scope, 83scope == ScopedKind.None) 106ScopedKind scope, 226internal sealed override ScopedKind DeclaredScope => _scope; 233internal abstract override ScopedKind EffectiveScope { get; } 235protected ScopedKind CalculateEffectiveScopeIgnoringAttributes() 237var declaredScope = this.DeclaredScope; 239if (declaredScope == ScopedKind.None) 243return ScopedKind.ScopedRef; 247return ScopedKind.ScopedValue;
Symbols\Source\SourceSimpleParameterSymbol.cs (2)
39: base(owner, ordinal, refKind, ScopedKind.None, name, location) 165internal override ScopedKind EffectiveScope => CalculateEffectiveScopeIgnoringAttributes();
Symbols\Source\ThisParameterSymbol.cs (7)
186internal override ScopedKind DeclaredScope => throw ExceptionUtilities.Unreachable(); 188internal override ScopedKind EffectiveScope 192var scope = _containingType.IsStructType() ? ScopedKind.ScopedRef : ScopedKind.None; 193if (scope != ScopedKind.None && 197return ScopedKind.None;
Symbols\Synthesized\SynthesizedAccessorValueParameterSymbol.cs (1)
29scope: ScopedKind.None)
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (2)
35internal ParameterDescription(TypeWithAnnotations type, RefKind refKind, ScopedKind scope, ConstantValue? defaultValue, bool isParams, bool hasUnscopedRefAttribute) 47internal readonly ScopedKind Scope;
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (1)
475) : base(container, TypeWithAnnotations.Create(type), ordinal, RefKind.None, ScopedKind.None, name)
Symbols\Synthesized\SynthesizedLocal.cs (2)
188internal sealed override ScopedKind Scope => ScopedKind.None;
Symbols\Synthesized\SynthesizedParameterSymbol.cs (8)
23private readonly ScopedKind _scope; 30ScopedKind scope, 225internal sealed override ScopedKind DeclaredScope => throw ExceptionUtilities.Unreachable(); 227internal sealed override ScopedKind EffectiveScope => _scope; 245ScopedKind scope, 263ScopedKind scope = ScopedKind.None, 353ScopedKind scope,
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (1)
122internal override ScopedKind Scope => throw new System.NotImplementedException();
Symbols\UpdatedContainingSymbolLocal.cs (1)
92internal override ScopedKind Scope => _underlyingLocal.Scope;
Symbols\Wrapped\WrappedParameterSymbol.cs (2)
162internal sealed override ScopedKind DeclaredScope => _underlyingParameter.DeclaredScope; 164internal sealed override ScopedKind EffectiveScope => _underlyingParameter.EffectiveScope;
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
479if (leftSymbol is not ILocalSymbol { ScopedKind: ScopedKind.ScopedValue }) 514if (local.ScopedKind == ScopedKind.ScopedValue) 547if (parameter.ScopedKind != ScopedKind.ScopedValue)
Microsoft.CodeAnalysis.CSharp.Features (3)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
479if (leftSymbol is not ILocalSymbol { ScopedKind: ScopedKind.ScopedValue }) 514if (local.ScopedKind == ScopedKind.ScopedValue) 547if (parameter.ScopedKind != ScopedKind.ScopedValue)
Microsoft.CodeAnalysis.VisualBasic (4)
Symbols\ParameterSymbol.vb (2)
312Private ReadOnly Property IParameterSymbol_ScopedKind As ScopedKind Implements IParameterSymbol.ScopedKind 314Return ScopedKind.None
Symbols\Source\LocalSymbol.vb (2)
304Private ReadOnly Property ILocalSymbol_ScopedKind As ScopedKind Implements ILocalSymbol.ScopedKind 306Return ScopedKind.None
Microsoft.CodeAnalysis.Workspaces (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationParameterSymbol.cs (2)
62public ScopedKind ScopedKind => ScopedKind.None;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxGeneratorInternalExtensions\SyntaxGeneratorInternal.cs (2)
113=> symbol is { RefKind: RefKind.Ref or RefKind.In or RefKind.RefReadOnlyParameter, ScopedKind: ScopedKind.ScopedRef } 114or { RefKind: RefKind.None, Type.IsRefLikeType: true, ScopedKind: ScopedKind.ScopedValue };
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
414if (paramSymbol.ScopedKind != ScopedKind.None)
Microsoft.Interop.SourceGeneration (3)
Marshalling\MarshallerHelpers.cs (1)
390if (typeInfo.ScopedKind != ScopedKind.None && typeInfo.RefKind != RefKind.Out)
TypePositionInfo.cs (2)
69public ScopedKind ScopedKind { get; init; } = ScopedKind.None;
Roslyn.Diagnostics.Analyzers (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationParameterSymbol.cs (2)
62public ScopedKind ScopedKind => ScopedKind.None;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxGeneratorInternalExtensions\SyntaxGeneratorInternal.cs (2)
113=> symbol is { RefKind: RefKind.Ref or RefKind.In or RefKind.RefReadOnlyParameter, ScopedKind: ScopedKind.ScopedRef } 114or { RefKind: RefKind.None, Type.IsRefLikeType: true, ScopedKind: ScopedKind.ScopedValue };