133 references to ScopedValue
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxGeneratorInternalExtensions\SyntaxGeneratorInternal.cs (1)
107
or { RefKind: RefKind.None, Type.IsRefLikeType: true, ScopedKind: ScopedKind.
ScopedValue
};
Microsoft.CodeAnalysis.CSharp (23)
Binder\Binder.ValueChecks.cs (3)
1232
{ EffectiveScope: ScopedKind.
ScopedValue
} => SafeContext.CurrentMethod,
4546
if (parameter.EffectiveScope == ScopedKind.
ScopedValue
)
5661
call.Method.Parameters[0].EffectiveScope == ScopedKind.
ScopedValue
)
Binder\Binder_Deconstruct.cs (1)
897
localSymbol.Scope == ScopedKind.
ScopedValue
&& !declTypeWithAnnotations.Type.IsErrorOrRefLikeOrAllowsRefLikeType())
Binder\Binder_Expressions.cs (1)
3189
if (localSymbol.Scope == ScopedKind.
ScopedValue
&& !declType.Type.IsErrorOrRefLikeOrAllowsRefLikeType())
Binder\Binder_Statements.cs (1)
1099
if (localSymbol.Scope == ScopedKind.
ScopedValue
&& !declTypeOpt.Type.IsErrorOrRefLikeOrAllowsRefLikeType())
Binder\ForEachLoopBinder.cs (1)
318
if (local.Scope == ScopedKind.
ScopedValue
&& !declType.Type.IsErrorOrRefLikeOrAllowsRefLikeType())
Binder\RefSafetyAnalysis.cs (1)
452
valEscapeScope = scopedModifier == ScopedKind.
ScopedValue
?
BoundTree\UnboundLambda.cs (4)
674
scope = ScopedKind.
ScopedValue
;
681
else if (scope == ScopedKind.
ScopedValue
&& _unboundLambda.ParameterAttributes(i).Any())
745
DeclaredScope(i) == ScopedKind.
ScopedValue
|| parameterScopesBuilder[i] == ScopedKind.
ScopedValue
) &&
BoundTree\VariablePendingInference.cs (1)
67
if (localSymbol.Scope == ScopedKind.
ScopedValue
&& !type.Type.IsErrorOrRefLikeOrAllowsRefLikeType())
Emitter\Model\PEModuleBuilder.cs (1)
1686
Debug.Assert(!ParameterHelpers.IsRefScopedByDefault(symbol) || scope == ScopedKind.
ScopedValue
);
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
227
(!builder.ReturnType.IsRefLikeType || builder.Parameters[0].EffectiveScope == ScopedKind.
ScopedValue
))
SymbolDisplay\SymbolDisplayVisitor.cs (1)
260
else if (symbol.ScopedKind == ScopedKind.
ScopedValue
)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
838
if (symbol.ScopedKind == ScopedKind.
ScopedValue
&&
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
338
scope = ScopedKind.
ScopedValue
;
Symbols\Source\ParameterHelpers.cs (2)
329
return scope == ScopedKind.
ScopedValue
;
976
scope = (refKind == RefKind.None) ? ScopedKind.
ScopedValue
: ScopedKind.ScopedRef;
Symbols\Source\SourceComplexParameterSymbol.cs (1)
1545
if (DeclaredScope == ScopedKind.
ScopedValue
&& !Type.IsErrorOrRefLikeOrAllowsRefLikeType())
Symbols\Source\SourceLocalSymbol.cs (1)
71
: isScoped ? ScopedKind.
ScopedValue
: ScopedKind.None;
Symbols\Source\SourceParameterSymbol.cs (1)
247
return ScopedKind.
ScopedValue
;
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
510
if (leftSymbol is not ILocalSymbol { ScopedKind: ScopedKind.
ScopedValue
})
545
if (local.ScopedKind == ScopedKind.
ScopedValue
)
578
if (parameter.ScopedKind != ScopedKind.
ScopedValue
)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (40)
Attributes\AttributeTests_LifetimeAnnotation.cs (1)
263
Assert.Equal(ScopedKind.
ScopedValue
, parameter.EffectiveScope);
RefStructInterfacesTests.cs (8)
21243
Assert.Equal(ScopedKind.
ScopedValue
, parameter.EffectiveScope);
21253
Assert.Equal(ScopedKind.
ScopedValue
, parameter.EffectiveScope);
21264
Assert.Equal(ScopedKind.
ScopedValue
, p.EffectiveScope);
21310
Assert.Equal(ScopedKind.
ScopedValue
, local.Scope);
21649
Assert.Equal(ScopedKind.
ScopedValue
, p.EffectiveScope);
21653
Assert.Equal(ScopedKind.
ScopedValue
, p.EffectiveScope);
21712
Assert.Equal(ScopedKind.
ScopedValue
, p.EffectiveScope);
21716
Assert.Equal(ScopedKind.
ScopedValue
, p.EffectiveScope);
Semantics\ParamsCollectionTests.cs (31)
8704
assertScope(ScopedKind.
ScopedValue
, p);
8803
assertScope(ScopedKind.
ScopedValue
, p);
8878
assertScope(ScopedKind.
ScopedValue
, p);
8883
symbolValidator: (m) => verifyScopeOnImport(m, ScopedKind.
ScopedValue
)).VerifyDiagnostics();
8921
assertScope(ScopedKind.
ScopedValue
, p);
8926
symbolValidator: (m) => verifyScopeOnImport(m, ScopedKind.
ScopedValue
)).VerifyDiagnostics();
9038
case ScopedKind.
ScopedValue
:
9276
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope);
9280
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope);
9284
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope);
9316
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope);
9320
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope);
9324
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope);
10172
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope);
10173
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope);
10176
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope);
10177
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope);
10180
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope);
10181
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope);
10214
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope);
10215
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope);
10218
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope);
10219
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope);
10222
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope);
10223
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope);
10256
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C1.Test1").Parameters.Single().EffectiveScope);
10257
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C2.Test1").Parameters.Single().EffectiveScope);
10260
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C1.Test2").Parameters.Single().EffectiveScope);
10261
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C2.Test2").Parameters.Single().EffectiveScope);
10264
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C1.Test3").Parameters.Single().EffectiveScope);
10265
Assert.Equal(ScopedKind.
ScopedValue
, comp.GetMember<MethodSymbol>("C2.Test3").Parameters.Single().EffectiveScope);
Microsoft.CodeAnalysis.CSharp.Features (3)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (3)
510
if (leftSymbol is not ILocalSymbol { ScopedKind: ScopedKind.
ScopedValue
})
545
if (local.ScopedKind == ScopedKind.
ScopedValue
)
578
if (parameter.ScopedKind != ScopedKind.
ScopedValue
)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (62)
Semantics\RefFieldTests.cs (62)
10920
VerifyParameterSymbol(parameters[1], "scoped R y1", RefKind.None, ScopedKind.
ScopedValue
);
11029
VerifyParameterSymbol(localFunctions[0].Parameters[1], "scoped R y1", RefKind.None, ScopedKind.
ScopedValue
);
11102
verifyParameter(delegateTypesAndLambdas[0], 1, "scoped R", "y1", RefKind.None, ScopedKind.
ScopedValue
, false, false);
11158
VerifyParameterSymbol(comp.GetMember<NamedTypeSymbol>("D1").DelegateInvokeMethod.Parameters[0], "scoped R r1", RefKind.None, ScopedKind.
ScopedValue
);
11246
VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F0").Parameters[0], "scoped R r", RefKind.None, ScopedKind.
ScopedValue
);
11356
VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F1").Parameters[0], "scoped scoped s", RefKind.None, ScopedKind.
ScopedValue
);
11603
VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Extensions.F1").Parameters[0], "scoped R<System.Object> r", RefKind.None, ScopedKind.
ScopedValue
);
11623
VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F2").Parameters[0], "params scoped System.Object[] args", RefKind.None, ScopedKind.
ScopedValue
);
11950
VerifyParameterSymbol(method.Parameters[0], "scoped R<System.Int32> x", RefKind.None, ScopedKind.
ScopedValue
);
11984
VerifyParameterSymbol(method.Parameters[0], "scoped R x", RefKind.None, ScopedKind.
ScopedValue
);
12064
VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.
ScopedValue
);
12067
VerifyLocalSymbol(locals[3], "scoped R r11", RefKind.None, ScopedKind.
ScopedValue
);
12201
VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.
ScopedValue
);
12387
VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.
ScopedValue
);
12388
VerifyLocalSymbol(locals[1], "scoped R r2", RefKind.None, ScopedKind.
ScopedValue
);
12389
VerifyLocalSymbol(locals[2], "scoped R r5", RefKind.None, ScopedKind.
ScopedValue
);
12390
VerifyLocalSymbol(locals[3], "scoped R r11", RefKind.None, ScopedKind.
ScopedValue
);
12391
VerifyLocalSymbol(locals[4], "scoped R r21", RefKind.None, ScopedKind.
ScopedValue
);
12392
VerifyLocalSymbol(locals[5], "scoped R r51", RefKind.None, ScopedKind.
ScopedValue
);
12798
VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.
ScopedValue
);
12799
VerifyLocalSymbol(locals[1], "scoped R r2", RefKind.None, ScopedKind.
ScopedValue
);
12800
VerifyLocalSymbol(locals[2], "scoped R r5", RefKind.None, ScopedKind.
ScopedValue
);
12801
VerifyLocalSymbol(locals[3], "scoped R r11", RefKind.None, ScopedKind.
ScopedValue
);
12802
VerifyLocalSymbol(locals[4], "scoped R r21", RefKind.None, ScopedKind.
ScopedValue
);
12803
VerifyLocalSymbol(locals[5], "scoped R r51", RefKind.None, ScopedKind.
ScopedValue
);
13157
VerifyLocalSymbol(locals[3], "scoped scoped s4", RefKind.None, ScopedKind.
ScopedValue
);
13212
VerifyLocalSymbol(locals[3], "scoped scoped s4", RefKind.None, ScopedKind.
ScopedValue
);
13270
VerifyLocalSymbol(locals[4], "scoped scoped s4", RefKind.None, ScopedKind.
ScopedValue
);
13271
VerifyLocalSymbol(locals[6], "scoped scoped s6", RefKind.None, ScopedKind.
ScopedValue
);
13315
VerifyLocalSymbol(locals[2], "scoped scoped s4", RefKind.None, ScopedKind.
ScopedValue
);
13316
VerifyLocalSymbol(locals[3], "scoped scoped s6", RefKind.None, ScopedKind.
ScopedValue
);
13448
VerifyLocalSymbol(locals[0], "scoped R<System.Int32> r1", RefKind.None, ScopedKind.
ScopedValue
);
13512
VerifyLocalSymbol(locals[0], "scoped R<System.Int32> r1", RefKind.None, ScopedKind.
ScopedValue
);
13588
VerifyLocalSymbol(locals[0], "scoped R<System.Int32> r1", RefKind.None, ScopedKind.
ScopedValue
);
13589
VerifyLocalSymbol(locals[2], "scoped R<System.Int32> r3", RefKind.None, ScopedKind.
ScopedValue
);
13659
VerifyLocalSymbol(locals[0], "scoped R<System.Int32> r1", RefKind.None, ScopedKind.
ScopedValue
);
13660
VerifyLocalSymbol(locals[1], "scoped R<System.Int32> r3", RefKind.None, ScopedKind.
ScopedValue
);
14527
VerifyLocalSymbol(locals[2], "scoped R r21", RefKind.None, ScopedKind.
ScopedValue
);
14528
VerifyLocalSymbol(locals[3], "scoped R r22", RefKind.None, ScopedKind.
ScopedValue
);
14601
VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.
ScopedValue
);
14846
VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.
ScopedValue
);
14847
VerifyLocalSymbol(locals[1], "scoped R r2", RefKind.None, ScopedKind.
ScopedValue
);
14848
VerifyLocalSymbol(locals[2], "scoped R r5", RefKind.None, ScopedKind.
ScopedValue
);
14849
VerifyLocalSymbol(locals[3], "scoped R r11", RefKind.None, ScopedKind.
ScopedValue
);
14850
VerifyLocalSymbol(locals[4], "scoped R r21", RefKind.None, ScopedKind.
ScopedValue
);
14851
VerifyLocalSymbol(locals[5], "scoped R r51", RefKind.None, ScopedKind.
ScopedValue
);
15057
VerifyLocalSymbol(locals[3], "scoped scoped s4", RefKind.None, ScopedKind.
ScopedValue
);
15141
VerifyLocalSymbol(locals[0], "scoped R<System.Int32> r1", RefKind.None, ScopedKind.
ScopedValue
);
17950
VerifyParameterSymbol(delegateInvokeMethods[0].Parameters[1], "scoped R arg2", RefKind.None, ScopedKind.
ScopedValue
);
24180
VerifyParameterSymbol(baseType.GetMethod("F2A").Parameters[0], "scoped R<System.Int32> r2", RefKind.None, ScopedKind.
ScopedValue
, expectedHasUnscopedRefAttribute: false);
27613
VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.
ScopedValue
);
27703
VerifyLocalSymbol(locals[0], "scoped R r1", RefKind.None, ScopedKind.
ScopedValue
);
27826
VerifyLocalSymbol(locals[3], "scoped scoped s4", RefKind.None, ScopedKind.
ScopedValue
);
27927
VerifyLocalSymbol(locals[3], "scoped scoped s4", RefKind.None, ScopedKind.
ScopedValue
);
27975
VerifyLocalSymbol(locals[0], "scoped R<System.Int32> r1", RefKind.None, ScopedKind.
ScopedValue
);
27976
VerifyLocalSymbol(locals[1], "scoped R<System.Int32> r3", RefKind.None, ScopedKind.
ScopedValue
);
28035
VerifyLocalSymbol(locals[0], "scoped R<System.Int32> r1", RefKind.None, ScopedKind.
ScopedValue
);
28036
VerifyLocalSymbol(locals[1], "scoped R<System.Int32> r3", RefKind.None, ScopedKind.
ScopedValue
);
28259
VerifyLocalSymbol(locals[0], "scoped R r2", RefKind.None, ScopedKind.
ScopedValue
);
28260
VerifyLocalSymbol(locals[1], "scoped R r5", RefKind.None, ScopedKind.
ScopedValue
);
28307
VerifyLocalSymbol(locals[0], "scoped R r2", RefKind.None, ScopedKind.
ScopedValue
);
28308
VerifyLocalSymbol(locals[1], "scoped R r5", RefKind.None, ScopedKind.
ScopedValue
);
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SyntaxGeneratorInternalExtensions\SyntaxGeneratorInternal.cs (1)
107
or { RefKind: RefKind.None, Type.IsRefLikeType: true, ScopedKind: ScopedKind.
ScopedValue
};