674 references to Ref
GenerateDocumentationAndConfigFiles (13)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (1)
18case RefKind.Ref:
ILLink.RoslynAnalyzer (4)
Metrics (10)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (1)
18case RefKind.Ref:
Metrics.Legacy (10)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (1)
18case RefKind.Ref:
Microsoft.CodeAnalysis (4)
Microsoft.CodeAnalysis.Analyzers (13)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (1)
18case RefKind.Ref:
Microsoft.CodeAnalysis.AnalyzerUtilities (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (1)
18case RefKind.Ref:
Microsoft.CodeAnalysis.BannedApiAnalyzers (13)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (1)
18case RefKind.Ref:
Microsoft.CodeAnalysis.CodeStyle (7)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
551case RefKind.Ref:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (1)
18case RefKind.Ref:
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
Microsoft.CodeAnalysis.CSharp (175)
Lowering\SpillSequenceSpiller.cs (6)
370var left = Spill(builder, assignment.Left, RefKind.Ref);
371var right = Spill(builder, assignment.Right, RefKind.Ref);
918left = Spill(leftBuilder, VisitExpression(ref leftBuilder, left), RefKind.Ref);
965receiver = Spill(leftBuilder, VisitExpression(ref leftBuilder, field.ReceiverOpt), RefKind.Ref);
1089result = receiver.Type.IsReadOnly ? RefKind.In : RefKind.Ref;
1317receiver = Spill(receiverBuilder, receiver, RefKind.Ref);
Microsoft.CodeAnalysis.CSharp.CodeStyle (7)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (47)
CodeGen\CodeGenFunctionPointersTests.cs (11)
146(RefKind.Ref, IsArrayType(IsSpecialType(SpecialType.System_Int32))),
147(RefKind.Ref, IsTypeName("C")),
148(RefKind.Ref, IsSpecialType(SpecialType.System_String)));
170(RefKind.Ref, IsArrayType(IsSpecialType(SpecialType.System_Int32))),
650(RefKind.Ref,
746(RefKind.Ref, IsSpecialType(SpecialType.System_Boolean)),
747(RefKind.Ref, IsSpecialType(SpecialType.System_Int32)));
7676parameterRefCustomModifiers: default, returnRefKind: RefKind.Ref, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty,
7685parameterRefCustomModifiers: default, returnRefKind: RefKind.Ref, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty,
7761returnRefKind: RefKind.Ref, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty,
7770returnRefKind: RefKind.Ref, parameterTypes: ImmutableArray<TypeWithAnnotations>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty,
CodeGen\CodeGenLocalFunctionTests.cs (11)
3136Assert.Equal(RefKind.Ref, goo.Parameters[0].RefKind);
3161Assert.Equal(RefKind.Ref, goo.Parameters[0].RefKind);
3162Assert.Equal(RefKind.Ref, bar.Parameters[0].RefKind);
3163Assert.Equal(RefKind.Ref, bar.Parameters[1].RefKind);
3214Assert.Equal(RefKind.Ref, inner.Parameters[0].RefKind);
3215Assert.Equal(RefKind.Ref, inner.Parameters[1].RefKind);
3216Assert.Equal(RefKind.Ref, middle.Parameters[0].RefKind);
3279Assert.Equal(RefKind.Ref, goo.Parameters[0].RefKind);
3318Assert.Equal(RefKind.Ref, goo.Parameters[1].RefKind);
3319Assert.Equal(RefKind.Ref, bar.Parameters[1].RefKind);
3320Assert.Equal(RefKind.Ref, bar.Parameters[2].RefKind);
CodeGen\CodeGenReadonlyStructTests.cs (8)
892Assert.Equal(RefKind.Ref, namedType.GetMethod("M1").ThisParameter.RefKind);
893Assert.Equal(RefKind.Ref, namedType.GetMethod("ToString").ThisParameter.RefKind);
1056Assert.Equal(RefKind.Ref, namedType.GetMethod("M1").ThisParameter.RefKind);
1057Assert.Equal(RefKind.Ref, namedType.GetMethod("ToString").ThisParameter.RefKind);
1595verifyReadOnly(s1.GetMethod("M1"), false, RefKind.Ref);
1599verifyReadOnly(s1.GetProperty("P1").SetMethod, false, RefKind.Ref);
1604verifyReadOnly(s1.GetProperty("P3").SetMethod, false, RefKind.Ref);
1606verifyReadOnly(s1.GetProperty("P4").GetMethod, false, RefKind.Ref);
Emit\InAttributeModifierTests.cs (12)
1821Assert.Equal(RefKind.Ref, method.RefKind);
1938Assert.Equal(RefKind.Ref, method.RefKind);
1946Assert.Equal(RefKind.Ref, method.RefKind);
1962Assert.Equal(RefKind.Ref, localFunc.RefKind);
2133Assert.Equal(RefKind.Ref, method.RefKind);
2147Assert.Equal(RefKind.Ref, localFunc.RefKind);
2274Assert.Equal(RefKind.Ref, method.RefKind);
2282Assert.Equal(RefKind.Ref, method.RefKind);
2298Assert.Equal(RefKind.Ref, localFunc.RefKind);
2372Assert.Equal(RefKind.Ref, localFunc.RefKind);
2477Assert.Equal(RefKind.Ref, localFunc.RefKind);
2591Assert.Equal(RefKind.Ref, method.RefKind);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (8)
Microsoft.CodeAnalysis.CSharp.Features (7)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (141)
Semantics\RefFieldTests.cs (116)
147VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F1"), "ref T S<T>.F1", RefKind.Ref, new string[0]);
153VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F1"), "ref T S<T>.F1", RefKind.Ref, new string[0]);
173VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref T S<T>.F", RefKind.Ref, new string[0]);
178VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref T S<T>.F", RefKind.Ref, new string[0]);
209VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref T S<T>.F", RefKind.Ref, new string[0]);
219VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref T S<T>.F", RefKind.Ref, new string[0]);
317VerifyFieldSymbol(field, "ref modopt(System.SByte) modopt(System.Object) System.Int32 A<System.Int32>.F", RefKind.Ref, new[] { "System.SByte", "System.Object" });
536VerifyFieldSymbol(tupleType.GetField("Item1"), "ref System.Int32 (System.Int32, System.Object).Item1", RefKind.Ref, new string[0] { });
537VerifyFieldSymbol(tupleType.GetField("Item2"), "ref modopt(System.Object) modopt(System.SByte) System.Object (System.Int32, System.Object).Item2", RefKind.Ref, new[] { "System.Object", "System.SByte" });
11057VerifyParameterSymbol(parameters[0], "ref R x2", RefKind.Ref, ScopedKind.None);
11058VerifyParameterSymbol(parameters[1], "scoped ref R y2", RefKind.Ref, ScopedKind.ScopedRef);
11102VerifyParameterSymbol(comp.GetMember<NamedTypeSymbol>("A").Constructors.Single(c => !c.IsImplicitlyDeclared).Parameters[0], "scoped ref T t", RefKind.Ref, ScopedKind.ScopedRef);
11164VerifyParameterSymbol(localFunctions[1].Parameters[0], "ref System.Int32 x2", RefKind.Ref, ScopedKind.None);
11165VerifyParameterSymbol(localFunctions[1].Parameters[1], "scoped ref System.Int32 y2", RefKind.Ref, ScopedKind.ScopedRef);
11170VerifyParameterSymbol(localFunctions[4].Parameters[0], "ref R x5", RefKind.Ref, ScopedKind.None);
11171VerifyParameterSymbol(localFunctions[4].Parameters[1], "scoped ref R y5", RefKind.Ref, ScopedKind.ScopedRef);
11237verifyParameter(delegateTypesAndLambdas[1], 0, "ref System.Int32", "x2", RefKind.Ref, ScopedKind.None, false, false);
11238verifyParameter(delegateTypesAndLambdas[1], 1, "scoped ref System.Int32", "y2", RefKind.Ref, ScopedKind.ScopedRef, false, false);
11244verifyParameter(delegateTypesAndLambdas[4], 0, "ref R", "x5", RefKind.Ref, ScopedKind.None, false, false);
11245verifyParameter(delegateTypesAndLambdas[4], 1, "scoped ref R", "y5", RefKind.Ref, ScopedKind.ScopedRef, false, false);
11293VerifyParameterSymbol(comp.GetMember<NamedTypeSymbol>("D2").DelegateInvokeMethod.Parameters[0], "scoped ref R r2", RefKind.Ref, ScopedKind.ScopedRef);
11359VerifyParameterSymbol(methods[1].Parameters[0], "ref R", RefKind.Ref, ScopedKind.None);
11360VerifyParameterSymbol(methods[1].Parameters[1], "ref System.Int32", RefKind.Ref, ScopedKind.None);
11361VerifyParameterSymbol(methods[2].Parameters[0], "ref R", RefKind.Ref, ScopedKind.None);
11381VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F3").Parameters[0], "scoped ref R r", RefKind.Ref, ScopedKind.ScopedRef);
11472VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F2").Parameters[0], "ref scoped s", RefKind.Ref, ScopedKind.None);
11473VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F4").Parameters[0], "scoped ref scoped s", RefKind.Ref, ScopedKind.ScopedRef);
11587VerifyParameterSymbol(parameters[1], "ref R b", RefKind.Ref, ScopedKind.None);
11623VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.ReturnRef").Parameters[0], "scoped ref R r", RefKind.Ref, ScopedKind.ScopedRef);
11667VerifyParameterSymbol(comp.GetMember<MethodSymbol>("S1.F1").ThisParameter, "ref S1 this", RefKind.Ref, ScopedKind.ScopedRef);
11670VerifyParameterSymbol(comp.GetMember<MethodSymbol>("R1.F1").ThisParameter, "ref R1 this", RefKind.Ref, ScopedKind.ScopedRef);
11681VerifyParameterSymbol(thisParameter, "ref S1 this", RefKind.Ref, ScopedKind.ScopedRef);
11710VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Extensions.F3").Parameters[0], "scoped ref T t", RefKind.Ref, ScopedKind.ScopedRef);
12167VerifyLocalSymbol(locals[1], "scoped ref R r2", RefKind.Ref, ScopedKind.ScopedRef);
12170VerifyLocalSymbol(locals[4], "scoped ref R r21", RefKind.Ref, ScopedKind.ScopedRef);
12304VerifyLocalSymbol(locals[1], "scoped ref R r2", RefKind.Ref, ScopedKind.ScopedRef);
13257VerifyLocalSymbol(locals[1], "ref scoped s2", RefKind.Ref, ScopedKind.None);
13258VerifyLocalSymbol(locals[2], "ref scoped s3", RefKind.Ref, ScopedKind.None);
13260VerifyLocalSymbol(locals[4], "scoped ref scoped s5", RefKind.Ref, ScopedKind.ScopedRef);
13261VerifyLocalSymbol(locals[5], "scoped ref scoped s6", RefKind.Ref, ScopedKind.ScopedRef);
13312VerifyLocalSymbol(locals[1], "ref scoped s2", RefKind.Ref, ScopedKind.None);
13313VerifyLocalSymbol(locals[2], "ref scoped s3", RefKind.Ref, ScopedKind.None);
13315VerifyLocalSymbol(locals[4], "scoped ref scoped s5", RefKind.Ref, ScopedKind.ScopedRef);
13316VerifyLocalSymbol(locals[5], "scoped ref scoped s6", RefKind.Ref, ScopedKind.ScopedRef);
13551VerifyLocalSymbol(locals[1], "scoped ref R<System.Int32> r3", RefKind.Ref, ScopedKind.ScopedRef);
13615VerifyLocalSymbol(locals[1], "scoped ref R<System.Int32> r3", RefKind.Ref, ScopedKind.ScopedRef);
13820VerifyLocalSymbol(locals[0], "ref System.Int32 a", RefKind.Ref, ScopedKind.None);
13821VerifyLocalSymbol(locals[1], "ref System.Int32 b", RefKind.Ref, ScopedKind.None);
14460VerifyLocalSymbol(locals[0], "scoped ref R r2", RefKind.Ref, ScopedKind.ScopedRef);
14461VerifyLocalSymbol(locals[1], "scoped ref R r5", RefKind.Ref, ScopedKind.ScopedRef);
14502VerifyLocalSymbol(locals[0], "scoped ref R r2", RefKind.Ref, ScopedKind.ScopedRef);
14503VerifyLocalSymbol(locals[1], "scoped ref R r5", RefKind.Ref, ScopedKind.ScopedRef);
14632VerifyLocalSymbol(locals[4], "ref R r31", RefKind.Ref, ScopedKind.None);
14633VerifyLocalSymbol(locals[5], "ref R r32", RefKind.Ref, ScopedKind.None);
14634VerifyLocalSymbol(locals[6], "scoped ref R r41", RefKind.Ref, ScopedKind.ScopedRef);
14635VerifyLocalSymbol(locals[7], "scoped ref R r42", RefKind.Ref, ScopedKind.ScopedRef);
14704VerifyLocalSymbol(locals[1], "scoped ref R r2", RefKind.Ref, ScopedKind.ScopedRef);
15157VerifyLocalSymbol(locals[1], "ref scoped s2", RefKind.Ref, ScopedKind.None);
15158VerifyLocalSymbol(locals[2], "ref scoped s3", RefKind.Ref, ScopedKind.None);
15160VerifyLocalSymbol(locals[4], "scoped ref scoped s5", RefKind.Ref, ScopedKind.ScopedRef);
15161VerifyLocalSymbol(locals[5], "scoped ref scoped s6", RefKind.Ref, ScopedKind.ScopedRef);
15244VerifyLocalSymbol(locals[1], "scoped ref R<System.Int32> r3", RefKind.Ref, ScopedKind.ScopedRef);
15863VerifyParameterSymbol(method.Parameters[0], "ref System.Int32 i", RefKind.Ref, ScopedKind.None);
18053VerifyParameterSymbol(delegateInvokeMethods[1].Parameters[1], "scoped ref System.Int32 arg2", RefKind.Ref, ScopedKind.ScopedRef);
23421VerifyParameterSymbol(type.GetMethod("Get").ThisParameter, "ref R1<System.Int32> this", RefKind.Ref, ScopedKind.ScopedRef, expectedHasUnscopedRefAttribute: false);
23422VerifyParameterSymbol(type.GetMethod("get_Item").ThisParameter, "ref R1<System.Int32> this", RefKind.Ref, ScopedKind.ScopedRef, expectedHasUnscopedRefAttribute: false);
23426VerifyParameterSymbol(type.GetMethod("Get").ThisParameter, "ref R2<System.Int32> this", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: true);
23427VerifyParameterSymbol(type.GetMethod("get_Item").ThisParameter, "ref R2<System.Int32> this", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: true);
23490VerifyParameterSymbol(type.GetMethod("Get").ThisParameter, "ref R1<System.Int32> this", RefKind.Ref, ScopedKind.ScopedRef, expectedHasUnscopedRefAttribute: false);
23491VerifyParameterSymbol(type.GetMethod("get_Item").ThisParameter, "ref R1<System.Int32> this", RefKind.Ref, ScopedKind.ScopedRef, expectedHasUnscopedRefAttribute: false);
23496VerifyParameterSymbol(type.GetMethod("Get").ThisParameter, "ref R2<System.Int32> this", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: true);
23497VerifyParameterSymbol(type.GetMethod("get_Item").ThisParameter, "ref R2<System.Int32> this", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: true);
23644VerifyParameterSymbol(parameters[1], "scoped ref R x", RefKind.Ref, ScopedKind.ScopedRef);
23645VerifyParameterSymbol(parameters[2], "ref R y", RefKind.Ref, ScopedKind.None);
23707VerifyParameterSymbol(baseType.GetMethod("F1A").Parameters[0], "ref R<System.Int32> r1", RefKind.Ref, ScopedKind.None);
23708VerifyParameterSymbol(baseType.GetMethod("F2A").Parameters[0], "scoped ref R<System.Int32> r2", RefKind.Ref, ScopedKind.ScopedRef);
23796VerifyParameterSymbol(type.GetMethod("F1").Parameters[0], "ref R<T> r1", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: true);
23880VerifyParameterSymbol(baseType.GetMethod("F4A").Parameters[0], "ref R<System.Int32> r4", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: true);
24055VerifyParameterSymbol(baseType.GetMethod("F1A").Parameters[0], "ref System.Int32 t1", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: false);
24056VerifyParameterSymbol(baseType.GetMethod("F2A").Parameters[0], "scoped ref System.Int32 t2", RefKind.Ref, ScopedKind.ScopedRef, expectedHasUnscopedRefAttribute: false);
24057VerifyParameterSymbol(baseType.GetMethod("F3A").Parameters[0], "ref System.Int32 t3", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: true);
24058VerifyParameterSymbol(baseType.GetMethod("F4A").Parameters[0], "ref System.Int32 t4", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: true);
24240VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F2").Parameters[0], "ref R<T> r2", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: true);
24524VerifyParameterSymbol(lambdas[0].Parameters[0], "ref System.Int32 i1", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: false);
24525VerifyParameterSymbol(lambdas[1].Parameters[0], "ref System.Int32 i2", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: true);
24526VerifyParameterSymbol(lambdas[2].Parameters[0], "ref System.Object o1", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: false);
24527VerifyParameterSymbol(lambdas[3].Parameters[0], "ref System.Object o2", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: true);
24561VerifyParameterSymbol(lambdas[0].Parameters[0], "scoped ref R<System.Int32> r1", RefKind.Ref, ScopedKind.ScopedRef, expectedHasUnscopedRefAttribute: false);
24562VerifyParameterSymbol(lambdas[1].Parameters[0], "ref R<System.Int32> r2", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: false);
24563VerifyParameterSymbol(lambdas[2].Parameters[0], "scoped ref R<System.Object> r1", RefKind.Ref, ScopedKind.ScopedRef, expectedHasUnscopedRefAttribute: false);
24564VerifyParameterSymbol(lambdas[3].Parameters[0], "ref R<System.Object> r2", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: false);
25087VerifyParameterSymbol(typeA.GetMethod("NoAttributes").Parameters[0], "ref R x", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: false);
25088VerifyParameterSymbol(typeA.GetMethod("ScopedRefOnly").Parameters[0], "scoped ref R x", RefKind.Ref, ScopedKind.ScopedRef, expectedHasUnscopedRefAttribute: false);
25089VerifyParameterSymbol(typeA.GetMethod("UnscopedRefOnly").Parameters[0], "ref R x", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: true);
25090VerifyParameterSymbol(typeA.GetMethod("ScopedRefAndUnscopedRef").Parameters[0], "ref R x", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: true);
25253VerifyParameterSymbol(comp.GetMember<MethodSymbol>("S1.F1").ThisParameter, "ref S1 this", RefKind.Ref, ScopedKind.ScopedRef);
25256VerifyParameterSymbol(comp.GetMember<MethodSymbol>("A.F4").Parameters[0], "ref R r4", RefKind.Ref, ScopedKind.None);
25296VerifyParameterSymbol(comp.GetMember<MethodSymbol>("S1.F1").ThisParameter, "ref S1 this", RefKind.Ref, ScopedKind.ScopedRef);
25299VerifyParameterSymbol(comp.GetMember<MethodSymbol>("A.F4").Parameters[0], "ref R r4", RefKind.Ref, ScopedKind.None);
25332verifyParameter(delegateTypesAndLambdas[2], 0, "ref R", "r3", RefKind.Ref, ScopedKind.None);
25382VerifyParameterSymbol(getFunctionPointerMethod(comp, "A.F3").Parameters[0], "ref R", RefKind.Ref, ScopedKind.None);
25450VerifyParameterSymbol(comp.GetMember<MethodSymbol>("S.F").ThisParameter, "ref S this", RefKind.Ref, scopedRefInCSharp10, expectedHasUnscopedRefAttribute: true);
25451VerifyParameterSymbol(comp.GetMember<PropertySymbol>("S.P").GetMethod.ThisParameter, "ref S this", RefKind.Ref, scopedRefInCSharp10, expectedHasUnscopedRefAttribute: true);
25454VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F3").Parameters[0], "ref R r3", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: true);
26069VerifyParameterSymbol(typeA.GetMethod("F1").Parameters[0], "ref R x", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: false);
26070VerifyParameterSymbol(typeA.GetMethod("F2").Parameters[0], "ref R x", RefKind.Ref, ScopedKind.None, expectedHasUnscopedRefAttribute: true);
27655VerifyLocalSymbol(locals[1], "scoped ref R r2", RefKind.Ref, ScopedKind.ScopedRef);
27745VerifyLocalSymbol(locals[1], "scoped ref R r2", RefKind.Ref, ScopedKind.ScopedRef);
27865VerifyLocalSymbol(locals[1], "ref scoped s2", RefKind.Ref, ScopedKind.None);
27866VerifyLocalSymbol(locals[2], "ref scoped s3", RefKind.Ref, ScopedKind.None);
27868VerifyLocalSymbol(locals[4], "scoped ref scoped s5", RefKind.Ref, ScopedKind.ScopedRef);
27869VerifyLocalSymbol(locals[5], "scoped ref scoped s6", RefKind.Ref, ScopedKind.ScopedRef);
27966VerifyLocalSymbol(locals[1], "ref scoped s2", RefKind.Ref, ScopedKind.None);
27967VerifyLocalSymbol(locals[2], "ref scoped s3", RefKind.Ref, ScopedKind.None);
27969VerifyLocalSymbol(locals[4], "scoped ref scoped s5", RefKind.Ref, ScopedKind.ScopedRef);
27970VerifyLocalSymbol(locals[5], "scoped ref scoped s6", RefKind.Ref, ScopedKind.ScopedRef);
Semantics\SimpleLambdaParametersWithModifiersTests.cs (21)
41Assert.Equal(RefKind.Ref, symbol.Parameters.Single().RefKind);
68Assert.True(symbol.Parameters is [{ Type.SpecialType: SpecialType.System_String, RefKind: RefKind.None }, { Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.Ref }]);
102{ Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.Ref, IsOptional: false }]);
169Assert.True(symbol.Parameters is [{ Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.Ref, IsOptional: false }]);
388{ Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.Ref }]);
481Assert.True(symbol.Parameters is [{ Name: "", Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.Ref, IsOptional: false }]);
513Assert.True(symbol.Parameters is [{ Name: "", Type: IErrorTypeSymbol { Name: "x" }, RefKind: RefKind.Ref, IsOptional: false }]);
546Assert.True(symbol.Parameters is [{ Name: "", Type: IErrorTypeSymbol { Name: "x" }, RefKind: RefKind.Ref, IsOptional: false }]);
579Assert.True(symbol.Parameters is [{ Name: "x", Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.Ref, IsOptional: false }]);
613parameter.RefKind == (passByRef ? RefKind.Ref : RefKind.None));
641Assert.True(symbol.Parameters is [{ Name: "x", Type.SpecialType: SpecialType.System_String, RefKind: RefKind.Ref, IsOptional: false }]);
790Assert.True(symbol.Parameters is [{ Name: "x", Type.SpecialType: SpecialType.System_Int32, RefKind: RefKind.Ref, IsOptional: false }]);
824Assert.True(symbol.Parameters is [{ Name: "x", Type.SpecialType: SpecialType.System_String, Type.NullableAnnotation: CodeAnalysis.NullableAnnotation.Annotated, RefKind: RefKind.Ref, IsOptional: false }]);
858Assert.True(symbol.Parameters is [{ Name: "x", Type.SpecialType: SpecialType.System_String, Type.NullableAnnotation: CodeAnalysis.NullableAnnotation.NotAnnotated, RefKind: RefKind.Ref, IsOptional: false }]);
890Assert.True(symbol.Parameters is [{ Name: "x", Type.TypeKind: TypeKind.Dynamic, RefKind: RefKind.Ref, IsOptional: false }]);
1000Assert.Equal(RefKind.Ref, symbol.Parameters.Single().RefKind);
1040Assert.True(symbol.Parameters is [{ Name: "x", Type: IArrayTypeSymbol { ElementType.SpecialType: SpecialType.System_Int32 }, RefKind: RefKind.Ref, IsParams: true }]);
1075Assert.True(symbol.Parameters is [{ Name: "x", Type: IArrayTypeSymbol { ElementType.SpecialType: SpecialType.System_Int32 }, RefKind: RefKind.Ref, IsParams: true }]);
1133Assert.True(symbol.Parameters is [{ Name: "x", Type: IErrorTypeSymbol, RefKind: RefKind.Ref, IsParams: false }]);
1332Assert.Equal(RefKind.Ref, symbol.Parameters.Single().RefKind);
1455Assert.Equal(RefKind.Ref, symbol.Parameters.Single().RefKind);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (39)
Symbols\FunctionPointerTypeSymbolTests.cs (12)
27[InlineData("ref", RefKind.Ref, "delegate*<ref System.Object>")]
114verifyRefKind(RefKind.Ref, mParams[1]);
115verifyRefKind(RefKind.Ref, mParams[2]);
119verifyRefKind(RefKind.Ref, mParams[6]);
199Assert.Equal(RefKind.Ref, firstSignature.RefKind);
472Assert.Equal(RefKind.Ref, firstParam.Parameters.Single().RefKind);
580Assert.Equal(RefKind.Ref, thirdParam.Parameters.Single().RefKind);
592Assert.Equal(RefKind.Ref, seventhParam.Parameters.Single().RefKind);
598Assert.Equal(RefKind.Ref, ninthParam.Parameters.Single().RefKind);
2050RefKind.Ref,
2117RefKind.Ref,
2176RefKind.Ref,
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
Microsoft.CodeAnalysis.CSharp.Workspaces (9)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
CodeGeneration\ExpressionGenerationTests.cs (4)
335f.Argument(null, RefKind.Ref, f.IdentifierName("b"))),
347f.Argument("n2", RefKind.Ref, f.IdentifierName("b"))),
391f.Argument(null, RefKind.Ref, f.IdentifierName("b"))),
403f.Argument("n2", RefKind.Ref, f.IdentifierName("b"))),
Microsoft.CodeAnalysis.Extensions.Package (1)
Microsoft.CodeAnalysis.Features (5)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
551case RefKind.Ref:
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (13)
Microsoft.CodeAnalysis.PublicApiAnalyzers (10)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (1)
18case RefKind.Ref:
Microsoft.CodeAnalysis.ResxSourceGenerator (10)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (1)
18case RefKind.Ref:
Microsoft.CodeAnalysis.Test.Utilities (3)
Microsoft.CodeAnalysis.UnitTests (1)
Microsoft.CodeAnalysis.VisualBasic (4)
Microsoft.CodeAnalysis.Workspaces (9)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (1)
18case RefKind.Ref:
Microsoft.Extensions.Logging.Generators (2)
Microsoft.Interop.SourceGeneration (6)
Microsoft.VisualStudio.LanguageServices (1)
Microsoft.VisualStudio.LanguageServices.CSharp (2)
Microsoft.VisualStudio.LanguageServices.Implementation (1)
Roslyn.Diagnostics.Analyzers (26)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (1)
18case RefKind.Ref:
Roslyn.Diagnostics.CSharp.Analyzers (9)
System.Text.Json.SourceGeneration (3)
Test.Utilities (10)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (1)
18case RefKind.Ref:
Text.Analyzers (13)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IParameterSymbolExtensions.cs (1)
18case RefKind.Ref: