251 references to Out
ILLink.RoslynAnalyzer (2)
IOperationExtensions.cs (1)
129 case RefKind.Out:
TrimAnalysis\ParameterProxy.cs (1)
28 case RefKind.Out: return ReferenceKind.Out;
Microsoft.AspNetCore.App.Analyzers (2)
src\Shared\RoslynUtils\ParsabilityHelper.cs (2)
101methodSymbol.Parameters[1].RefKind == RefKind.Out; 112methodSymbol.Parameters[2].RefKind == RefKind.Out;
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
src\Shared\RoslynUtils\ParsabilityHelper.cs (2)
101methodSymbol.Parameters[1].RefKind == RefKind.Out; 112methodSymbol.Parameters[2].RefKind == RefKind.Out;
Microsoft.CodeAnalysis (5)
Compilation\Compilation.cs (1)
1120/// * <see cref="RefKind.Out"/> is passed as the returnRefKind.
Operations\ControlFlowGraphBuilder.cs (1)
6825Debug.Assert(outParameterArgument is { Parameter: { RefKind: RefKind.Out, Type.SpecialType: SpecialType.System_Boolean } });
Symbols\RefKind.cs (3)
56case RefKind.Out: return "out"; 68case RefKind.Out: return "out"; 79case RefKind.Out: return "out ";
Microsoft.CodeAnalysis.CodeStyle (4)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
544case RefKind.Out:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IParameterSymbolExtensions.cs (1)
16case RefKind.Out:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
166case RefKind.Out:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
441if (parameter.RefKind is RefKind.Ref or RefKind.Out)
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
220parameter.RefKind is RefKind.Out ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (3)
298if (parameter.RefKind != RefKind.Out && 320if (parameter.RefKind != RefKind.Out && 362if (refKind == RefKind.Out)
Microsoft.CodeAnalysis.CSharp (82)
Binder\Binder.ValueChecks.cs (4)
1233{ RefKind: RefKind.Out, UseUpdatedEscapeRules: true } => SafeContext.ReturnOnly, 1247{ HasUnscopedRefAttribute: true, UseUpdatedEscapeRules: true, RefKind: RefKind.Out } => SafeContext.ReturnOnly, 2628if (parameter.Type.IsRefLikeOrAllowsRefLikeType() && parameter.RefKind != RefKind.Out && GetParameterValEscapeLevel(parameter) is { } valEscapeLevel) 2992Debug.Assert(underlyingParameter.RefKind != RefKind.Out); // Shouldn't get here for a constructor
Binder\Binder_Deconstruct.cs (2)
647analyzedArguments.RefKinds.Add(RefKind.Out); 687if (parameters[i].RefKind != RefKind.Out)
Binder\Binder_Expressions.cs (1)
4979if (analyzedArguments.RefKind(i) is (RefKind.Ref or RefKind.Out))
Binder\Binder_InterpolatedString.cs (1)
727refKindsBuilder.Add(RefKind.Out);
Binder\Binder_Statements.cs (1)
1446if (lhsRefKind is RefKind.Ref or RefKind.Out)
Binder\Semantics\Conversions\ConversionsBase.cs (1)
1571if (delegateParameters[p].RefKind == RefKind.Out)
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
1260refParameter != RefKind.Out)
BoundTree\Constructors.cs (1)
194Debug.Assert(argumentRefKind is RefKind.None or RefKind.Ref or RefKind.In or RefKind.Out or RefKindExtensions.StrictIn &&
CodeGen\EmitExpression.cs (1)
729Debug.Assert(refKind is RefKind.Ref or RefKind.Out or RefKindExtensions.StrictIn);
Compilation\CSharpCompilation.cs (1)
4076if (returnRefKind == RefKind.Out)
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (1)
705case RefKind.Out when allowOut:
FlowAnalysis\AbstractFlowPass.cs (3)
1529if (refKind != RefKind.Out) 1556case RefKind.Out: 3492this.WriteArgument(operand, RefKind.Out, null); //Out because we know it will definitely be assigned.
FlowAnalysis\AlwaysAssignedWalker.cs (1)
75if (refKind == RefKind.Out)
FlowAnalysis\DefiniteAssignment.cs (7)
1234((ParameterSymbol)symbol).RefKind == RefKind.Out) 1622if (isRef && param.RefKind == RefKind.Out) 1814if (parameter.RefKind != RefKind.Out) 1826if (thisParameter.RefKind != RefKind.Out) 1849if (current is not MethodSymbol && parameter.RefKind == RefKind.Out) 1879if (parameter.RefKind == RefKind.Out && !(this.CurrentSymbol is MethodSymbol currentMethod && currentMethod.IsAsync)) // out parameters not allowed in async 1945if (!parameter.IsThis && parameter.RefKind != RefKind.Out && parameter.ContainingSymbol is SynthesizedPrimaryConstructor primaryCtor)
FlowAnalysis\NullableWalker.cs (7)
1317if (refKind != RefKind.Out && refKind != RefKind.Ref) 2445AreParameterAnnotationsCompatible(RefKind.Out, overriddenType, overriddenAnnotations, overridingType, overridingAnnotations); 2478if (refKind == RefKind.Out) 2883if (parameter.RefKind != RefKind.Out) 7384case RefKind.Out: 7481case RefKind.Out: 7591case RefKind.Out:
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (2)
307if (parameter.RefKind == RefKind.Out || parameter.IsDiscard) 577if (refKinds[i] is not (RefKind.Ref or RefKind.Out))
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (2)
188Debug.Assert(parameter.RefKind == RefKind.Out); 190addArg(RefKind.Out, _tempAllocator.GetTemp(outputTemp));
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (2)
506readOnlySpanCtorRefParamGeneric.Parameters[0].RefKind != RefKind.Out) 544Debug.Assert(readOnlySpanCtorRefParamChar.Parameters[0].RefKind != RefKind.Out);
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (1)
46if (construction.ArgumentRefKindsOpt[i] == RefKind.Out)
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (2)
817Debug.Assert(refKind == RefKind.None || refKind == RefKind.Ref || refKind == RefKind.Out, "unexpected refKind in dynamic"); 820if (refKind == RefKind.Out)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
641Debug.Assert(refKind is RefKindExtensions.StrictIn or RefKind.Ref or RefKind.Out);
Lowering\SyntheticBoundNodeFactory.cs (1)
1650case RefKind.Out:
SymbolDisplay\SymbolDisplayVisitor.Members.cs (2)
818symbol.RefKind != RefKind.Out && 1132case RefKind.Out:
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (6)
312Debug.Assert(refKind is RefKind.None or RefKind.In or RefKind.Ref or RefKind.Out); 317RefKind.Out => compilation.GetWellKnownType(WellKnownType.System_Runtime_InteropServices_OutAttribute), 323Debug.Assert(refKind != RefKind.Out && refKind != RefKind.In); 496Debug.Assert(refKind != RefKind.Out); 554Debug.Assert(RefKind != RefKind.Out); 569RefKind paramRefKind = getRefKind(param, paramRefCustomMods, RefKind.In, RefKind.Out, requiresLocationAllowed: true);
Symbols\FunctionPointers\FunctionPointerParameterSymbol.cs (1)
79internal override bool IsMetadataOut => RefKind == RefKind.Out;
Symbols\MemberSignatureComparer.cs (1)
254/// the difference between <see cref="RefKind.Out"/> and <see cref="RefKind.Ref"/>.
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1156case RefKind.Out:
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
292refKind = RefKind.Out;
Symbols\MethodSymbol.cs (1)
229Debug.Assert(this.RefKind != RefKind.Out);
Symbols\PropertySymbolExtensions.cs (1)
73if (param.RefKind == RefKind.Ref || param.RefKind == RefKind.Out)
Symbols\RefKindExtensions.cs (2)
28return RefKind.Out; 43case RefKind.Out:
Symbols\Source\ParameterHelpers.cs (5)
94RefKind.Out => CreateOutModifiers(binder, diagnostics, syntax), 183if (!allowRefOrOut && (refKind == RefKind.Ref || refKind == RefKind.Out)) 341return useUpdatedEscapeRules && refKind == RefKind.Out; 746if (refKind == RefKind.Ref || refKind == RefKind.Out) 938refKind = RefKind.Out;
Symbols\Source\SourceComplexParameterSymbol.cs (1)
1415case RefKind.Out:
Symbols\Source\SourceMemberContainerSymbol.cs (1)
4308RefKind.Out
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (4)
1278overrideMethod.RefKind == RefKind.Ref ? RefKind.Ref : RefKind.Out, 1356case RefKind.Out: 1395else if (parameters.Any(p => (p.RefKind is RefKind.Ref or RefKind.Out) && p.Type.IsRefLikeOrAllowsRefLikeType())) 1406int nRefParameters = parameters.Count(p => p.RefKind is RefKind.Ref or RefKind.In or RefKind.RefReadOnlyParameter or RefKind.Out);
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
769if (param.RefKind == RefKind.Out)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
819else if (IsPartial && !HasExplicitAccessModifier && Parameters.Any(static p => p.RefKind == RefKind.Out))
Symbols\Source\SourceParameterSymbol.cs (1)
297internal override bool IsMetadataOut => RefKind == RefKind.Out;
Symbols\Source\ThisParameterSymbol.cs (1)
154return RefKind.Out;
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (1)
41RefKind.Out,
Symbols\Synthesized\RefKindVector.cs (2)
48(false, true, false) => RefKind.Out, 61RefKind.Out => (false, true, false),
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (1)
474internal override bool IsMetadataOut => RefKind == RefKind.Out;
Symbols\Synthesized\SynthesizedLocal.cs (1)
51Debug.Assert(refKind != RefKind.Out);
Symbols\Synthesized\SynthesizedParameterSymbol.cs (2)
253internal sealed override bool IsMetadataOut => RefKind == RefKind.Out; 408internal override bool IsMetadataOut => RefKind == RefKind.Out || _baseParameterForAttributes?.GetDecodedWellKnownAttributeData()?.HasOutAttribute == true;
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
318if (primaryConstructor.Parameters.Any(static p => p.RefKind is RefKind.Ref or RefKind.Out))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ArgumentSyntaxExtensions.cs (2)
28SyntaxKind.OutKeyword => RefKind.Out, 82parameter.RefKind != RefKind.Out)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (1)
115.Where(p => p.RefKind == RefKind.Out)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (2)
53refKind: RefKind.Out, 65attributes: default, RefKind.Out, isParams: false, element.Type, element.Name));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
146case RefKind.Out:
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (17)
CodeGen\CodeGenFunctionPointersTests.cs (4)
171(RefKind.Out, IsTypeName("C")), 172(RefKind.Out, IsSpecialType(SpecialType.System_String))); 574(RefKind.Out, IsSpecialType(SpecialType.System_Int32))); 584(RefKind.Out, IsSpecialType(SpecialType.System_Int32)));
CodeGen\CodeGenLocalFunctionTests.cs (1)
6170var synthesizedParam = SynthesizedParameterSymbol.Create(localFunction, param.TypeWithAnnotations, ordinal: 0, RefKind.Out, param.Name, baseParameterForAttributes: (SourceComplexParameterSymbolBase)param);
CodeGen\CodeGenReadonlyStructTests.cs (11)
829Assert.Equal(RefKind.Out, namedType.Constructors[0].ThisParameter.RefKind); 846Assert.Equal(RefKind.Out, namedType.Constructors[0].ThisParameter.RefKind); 853Assert.Equal(RefKind.Out, namedType.Constructors[0].ThisParameter.RefKind); 860Assert.Equal(RefKind.Out, namedType.Constructors[0].ThisParameter.RefKind); 867Assert.Equal(RefKind.Out, namedType.Constructors[0].ThisParameter.RefKind); 913Assert.Equal(RefKind.Out, s1.Constructors[0].ThisParameter.RefKind); 1003Assert.Equal(RefKind.Out, namedType.Constructors[0].ThisParameter.RefKind); 1010Assert.Equal(RefKind.Out, namedType.Constructors[0].ThisParameter.RefKind); 1017Assert.Equal(RefKind.Out, namedType.Constructors[0].ThisParameter.RefKind); 1024Assert.Equal(RefKind.Out, namedType.Constructors[0].ThisParameter.RefKind); 1031Assert.Equal(RefKind.Out, namedType.Constructors[0].ThisParameter.RefKind);
Emit\EmitMetadataTests.cs (1)
2028Assert.Equal(RefKind.Out, m.Parameters[2].RefKind);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (2)
Semantics\RecordTests.cs (2)
14166Assert.Equal(RefKind.Out, deconstruct.Parameters[0].RefKind); 14169Assert.Equal(RefKind.Out, deconstruct.Parameters[1].RefKind);
Microsoft.CodeAnalysis.CSharp.Features (7)
Completion\CompletionProviders\CrefCompletionProvider.cs (1)
314RefKind.Out => "out ",
Completion\Providers\ContextVariableArgumentProvider.cs (1)
42case RefKind.Out:
Completion\Providers\OutVariableArgumentProvider.cs (1)
35if (context.Parameter.RefKind != RefKind.Out)
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
318if (primaryConstructor.Parameters.Any(static p => p.RefKind is RefKind.Ref or RefKind.Out))
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (1)
115.Where(p => p.RefKind == RefKind.Out)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateDeconstructMethodService.cs (2)
53refKind: RefKind.Out, 65attributes: default, RefKind.Out, isParams: false, element.Type, element.Name));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (50)
Semantics\LambdaTests.cs (1)
6901Assert.Equal(RefKind.Out, lambdas[2].Parameters[0].RefKind);
Semantics\RecordStructTests.cs (2)
3441Assert.Equal(RefKind.Out, deconstruct.Parameters[0].RefKind); 3444Assert.Equal(RefKind.Out, deconstruct.Parameters[1].RefKind);
Semantics\RefFieldTests.cs (47)
10931VerifyParameterSymbol(parameters[0], "out R x4", RefKind.Out, useUpdatedEscapeRules ? ScopedKind.ScopedRef : ScopedKind.None); 10932VerifyParameterSymbol(parameters[1], "out R y4", RefKind.Out, ScopedKind.ScopedRef); 11034VerifyParameterSymbol(localFunctions[3].Parameters[0], "out System.Int32 x4", RefKind.Out, useUpdatedEscapeRules ? ScopedKind.ScopedRef : ScopedKind.None); 11035VerifyParameterSymbol(localFunctions[3].Parameters[1], "out System.Int32 y4", RefKind.Out, ScopedKind.ScopedRef); 11040VerifyParameterSymbol(localFunctions[6].Parameters[0], "out R x7", RefKind.Out, useUpdatedEscapeRules ? ScopedKind.ScopedRef : ScopedKind.None); 11041VerifyParameterSymbol(localFunctions[6].Parameters[1], "out R y7", RefKind.Out, ScopedKind.ScopedRef); 11107verifyParameter(delegateTypesAndLambdas[3], 0, "out System.Int32", "x4", RefKind.Out, useUpdatedEscapeRules ? ScopedKind.ScopedRef : ScopedKind.None, false, false); 11108verifyParameter(delegateTypesAndLambdas[3], 1, "out System.Int32", "y4", RefKind.Out, ScopedKind.ScopedRef, false, false); 11109verifyParameter(delegateTypesAndLambdas[3], 2, "out System.Int32", "z4", RefKind.Out, ScopedKind.None, true, useUpdatedEscapeRules); 11114verifyParameter(delegateTypesAndLambdas[6], 0, "out R", "x7", RefKind.Out, useUpdatedEscapeRules ? ScopedKind.ScopedRef : ScopedKind.None, false, false); 11115verifyParameter(delegateTypesAndLambdas[6], 1, "out R", "y7", RefKind.Out, ScopedKind.ScopedRef, false, false); 11249VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F9").Parameters[0], "out R r", RefKind.Out, ScopedKind.ScopedRef); 11361VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F8").Parameters[0], "out scoped s", RefKind.Out, ScopedKind.ScopedRef); 11362VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.FA").Parameters[0], "out scoped s", RefKind.Out, ScopedKind.ScopedRef); 11437VerifyParameterSymbol(comp.GetMember<PEMethodSymbol>("A.F1").Parameters[0], "out System.Int32 i", RefKind.Out, ScopedKind.ScopedRef); 11474VerifyParameterSymbol(parameters[3], "out R d", RefKind.Out, ScopedKind.ScopedRef); 11551VerifyParameterSymbol(comp.GetMember<MethodSymbol>("S1..ctor").ThisParameter, "out S1 this", RefKind.Out, ScopedKind.ScopedRef); 11554VerifyParameterSymbol(comp.GetMember<MethodSymbol>("R1..ctor").ThisParameter, "out R1 this", RefKind.Out, ScopedKind.ScopedRef); 11557VerifyParameterSymbol(comp.GetMember<MethodSymbol>("S2..ctor").ThisParameter, "out S2 this", RefKind.Out, ScopedKind.ScopedRef); 11560VerifyParameterSymbol(comp.GetMember<MethodSymbol>("R2..ctor").ThisParameter, "out R2 this", RefKind.Out, ScopedKind.ScopedRef); 23765VerifyParameterSymbol(type.GetMethod("F2").Parameters[0], "out T t2", RefKind.Out, ScopedKind.None, expectedHasUnscopedRefAttribute: true); 23899VerifyParameterSymbol(parameters[1], "out System.Int32 x", RefKind.Out, ScopedKind.ScopedRef, expectedHasUnscopedRefAttribute: false); 23900VerifyParameterSymbol(parameters[2], "out System.Int32 y", RefKind.Out, ScopedKind.None, expectedHasUnscopedRefAttribute: true); 23958VerifyParameterSymbol(baseType.GetMethod("F1A").Parameters[0], "out System.Int32 t1", RefKind.Out, ScopedKind.ScopedRef, expectedHasUnscopedRefAttribute: false); 23959VerifyParameterSymbol(baseType.GetMethod("F2A").Parameters[0], "out System.Int32 t2", RefKind.Out, ScopedKind.ScopedRef, expectedHasUnscopedRefAttribute: false); 23960VerifyParameterSymbol(baseType.GetMethod("F3A").Parameters[0], "out System.Int32 t3", RefKind.Out, ScopedKind.None, expectedHasUnscopedRefAttribute: true); 24210VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F4").Parameters[0], "out R<T> r4", RefKind.Out, ScopedKind.None, expectedHasUnscopedRefAttribute: true); 24456VerifyParameterSymbol(lambdas[0].Parameters[0], "out System.Int32 i1", RefKind.Out, ScopedKind.ScopedRef, expectedHasUnscopedRefAttribute: false); 24457VerifyParameterSymbol(lambdas[1].Parameters[0], "out System.Int32 i2", RefKind.Out, ScopedKind.None, expectedHasUnscopedRefAttribute: true); 24458VerifyParameterSymbol(lambdas[2].Parameters[0], "out System.Object o1", RefKind.Out, ScopedKind.ScopedRef, expectedHasUnscopedRefAttribute: false); 24459VerifyParameterSymbol(lambdas[3].Parameters[0], "out System.Object o2", RefKind.Out, ScopedKind.None, expectedHasUnscopedRefAttribute: true); 24953VerifyParameterSymbol(typeA.GetMethod("NoAttributes").Parameters[0], "out System.Int32 i", RefKind.Out, ScopedKind.ScopedRef, expectedHasUnscopedRefAttribute: false); 24954VerifyParameterSymbol(typeA.GetMethod("ScopedRefOnly").Parameters[0], "out System.Int32 i", RefKind.Out, ScopedKind.ScopedRef, expectedHasUnscopedRefAttribute: false); 24955VerifyParameterSymbol(typeA.GetMethod("UnscopedRefOnly").Parameters[0], "out System.Int32 i", RefKind.Out, ScopedKind.None, expectedHasUnscopedRefAttribute: true); 24956VerifyParameterSymbol(typeA.GetMethod("ScopedRefAndUnscopedRef").Parameters[0], "out System.Int32 i", RefKind.Out, ScopedKind.None, expectedHasUnscopedRefAttribute: true); 25223VerifyParameterSymbol(comp.GetMember<MethodSymbol>("A.F3").Parameters[0], "out System.Int32 i3", RefKind.Out, useUpdatedRules ? ScopedKind.ScopedRef : ScopedKind.None); 25266VerifyParameterSymbol(comp.GetMember<MethodSymbol>("A.F3").Parameters[0], "out System.Int32 i3", RefKind.Out, useUpdatedRules ? ScopedKind.ScopedRef : ScopedKind.None); 25298verifyParameter(delegateTypesAndLambdas[0], 0, "out System.Int32", "i1", RefKind.Out, useUpdatedRules ? ScopedKind.ScopedRef : ScopedKind.None); 25302verifyParameter(delegateTypesAndLambdas[4], 0, "out R", "r5", RefKind.Out, useUpdatedRules ? ScopedKind.ScopedRef : ScopedKind.None); 25348VerifyParameterSymbol(getFunctionPointerMethod(comp, "A.F1").Parameters[0], "out modreq(System.Runtime.InteropServices.OutAttribute) System.Int32", RefKind.Out, useUpdatedRules ? ScopedKind.ScopedRef : ScopedKind.None); 25352VerifyParameterSymbol(getFunctionPointerMethod(comp, "A.F5").Parameters[0], "out modreq(System.Runtime.InteropServices.OutAttribute) R", RefKind.Out, useUpdatedRules ? ScopedKind.ScopedRef : ScopedKind.None); 25420VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F1").Parameters[0], "out System.Int32 i1", RefKind.Out, ScopedKind.None, expectedHasUnscopedRefAttribute: true); 25424VerifyParameterSymbol(comp.GetMember<MethodSymbol>("Program.F5").Parameters[0], "out R r5", RefKind.Out, ScopedKind.None, expectedHasUnscopedRefAttribute: true); 26993VerifyParameterSymbol(method.Parameters[0], "out System.Int32 i", RefKind.Out, version == 11 ? ScopedKind.ScopedRef : ScopedKind.None); 27032VerifyParameterSymbol(method.Parameters[0], "out System.Int32 i", RefKind.Out, ScopedKind.None); 27071VerifyParameterSymbol(method.Parameters[0], "out System.Int32 i", RefKind.Out, ScopedKind.None); 27121VerifyParameterSymbol(method.Parameters[0], "out T t", RefKind.Out, expectedUseUpdatedEscapeRules ? ScopedKind.ScopedRef : ScopedKind.None);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (15)
DocumentationComments\CrefTests.cs (1)
1314Single(m => m.ParameterRefKinds.Single() == RefKind.Out);
Symbols\CompilationCreationTests.cs (1)
2362Assert.Equal(RefKind.Out, x2.RefKind);
Symbols\FunctionPointerTypeSymbolTests.cs (6)
478Assert.Equal(RefKind.Out, thirdParam.Parameters.Single().RefKind); 586Assert.Equal(RefKind.Out, fifthParam.Parameters.Single().RefKind); 595Assert.Equal(RefKind.Out, eightParam.Parameters.Single().RefKind); 1538Assert.Throws<ArgumentException>(() => comp.CreateFunctionPointerTypeSymbol(returnType: @string, returnRefKind: RefKind.Out, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty)); 1603ImmutableArray.Create(RefKind.Out)); 1621ImmutableArray.Create(RefKind.Out));
Symbols\Metadata\MetadataMemberTests.cs (1)
289Assert.Equal(RefKind.Out, p6.RefKind);
Symbols\PEParameterSymbolTests.cs (2)
112Assert.Equal(RefKind.Out, x.RefKind); 127Assert.Equal(RefKind.Out, x1.RefKind);
Symbols\Source\MethodTests.cs (2)
364Assert.Equal(RefKind.Out, p2.RefKind); 455Assert.Equal(RefKind.Out, p2.RefKind);
Symbols\TypeTests.cs (2)
516Assert.Equal(RefKind.Out, p2.RefKind); 1559Assert.Equal(RefKind.Out, paras[1].RefKind);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
Extensions.cs (1)
216m.Parameters.All(p => p.RefKind == RefKind.Out && p.Type.Equals(primaryConstructor.Parameters[p.Ordinal].Type, SymbolEqualityComparer.Default)));
FunctionPointerUtilities.cs (2)
294case RefKind.Out: 309case RefKind.Out:
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
214case RefKind.Out:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ArgumentSyntaxExtensions.cs (2)
28SyntaxKind.OutKeyword => RefKind.Out, 82parameter.RefKind != RefKind.Out)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
146case RefKind.Out:
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.cs (1)
468VerifySyntax<InvocationExpressionSyntax>(Generator.InvocationExpression(Generator.IdentifierName("x"), Generator.Argument(RefKind.Out, Generator.IdentifierName("y"))), "x(out y)");
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
CodeGeneration\ExpressionGenerationTests.cs (4)
395f.Argument(null, RefKind.Out, f.IdentifierName("a")), 409f.Argument("n1", RefKind.Out, f.IdentifierName("a")), 461f.Argument(null, RefKind.Out, f.IdentifierName("a")), 475f.Argument("n1", RefKind.Out, f.IdentifierName("a")),
Microsoft.CodeAnalysis.Features (7)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
875CodeGenerationSymbolFactory.CreateParameterSymbol(RefKind.Out, p.Type, p.Name)),
EditAndContinue\Utilities\Extensions.cs (1)
182static (param, constructor) => param.RefKind == RefKind.Out && param.Type.Equals(constructor.Parameters[param.Ordinal].Type, SymbolEqualityComparer.Default),
ExtractMethod\MethodExtractor.CodeGenerator.cs (1)
378ParameterBehavior.Out => RefKind.Out,
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
258if (parameter.RefKind == RefKind.Out)
RQName\RQNodeBuilder.cs (1)
152if (parameter.RefKind == RefKind.Out)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
544case RefKind.Out:
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
220parameter.RefKind is RefKind.Out ||
Microsoft.CodeAnalysis.Test.Utilities (3)
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (1)
90if (argument.Parameter.RefKind == RefKind.Out || argument.Parameter.RefKind == RefKind.Ref)
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (1)
78if (argument.Parameter.RefKind == RefKind.Out || argument.Parameter.RefKind == RefKind.Ref)
Diagnostics\LocalCouldBeConstAnalyzer.cs (1)
71if (argument.Parameter.RefKind == RefKind.Out || argument.Parameter.RefKind == RefKind.Ref)
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.vb (1)
427VerifySyntax(Of InvocationExpressionSyntax)(Generator.InvocationExpression(Generator.IdentifierName("x"), Generator.Argument(RefKind.Out, Generator.IdentifierName("y"))), "x(y)")
Microsoft.CodeAnalysis.Workspaces (8)
ReassignedVariable\AbstractReassignedVariableService.cs (2)
211symbolIsDefinitelyAssigned: parameter.RefKind != RefKind.Out, 235symbolIsDefinitelyAssigned: parameter.RefKind != RefKind.Out,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IParameterSymbolExtensions.cs (1)
16case RefKind.Out:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
166case RefKind.Out:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
441if (parameter.RefKind is RefKind.Ref or RefKind.Out)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (3)
298if (parameter.RefKind != RefKind.Out && 320if (parameter.RefKind != RefKind.Out && 362if (refKind == RefKind.Out)
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
372else if (paramSymbol.RefKind == RefKind.Out)
Microsoft.Interop.ComInterfaceGenerator (1)
ComInterfaceGenerator.cs (1)
314RefKind = RefKind.Out,
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\ConvertToLibraryImportFixer.cs (1)
245editor.Generator.ParameterDeclaration("@return", editor.Generator.GetType(generatedDeclaration), refKind: RefKind.Out)
Analyzers\CustomMarshallerAttributeFixer.cs (1)
262gen.ParameterDeclaration("numElements", type: gen.TypeExpression(SpecialType.System_Int32), refKind: RefKind.Out),
Microsoft.Interop.SourceGeneration (12)
MarshallerShape.cs (2)
317&& m.Parameters[1].RefKind == RefKind.Out); 328&& m.Parameters[2].RefKind == RefKind.Out);
Marshalling\ElementsMarshalling.cs (1)
605return context.ElementIndirectionLevel != 0 || info.ByValueContentsMarshalKind == ByValueContentsMarshalKind.Out || info.RefKind == RefKind.Out || info.IsNativeReturnPosition;
Marshalling\MarshallerHelpers.cs (8)
25ByValueContentsMarshalKind.Out => RefKind.Out, 322case RefKind.Out: 344case RefKind.Out: 382if (!(info.RefKind is RefKind.Out 387if (countInfo.ElementInfo.IsByRef && countInfo.ElementInfo.RefKind is RefKind.Out) 417if (typeInfo.ScopedKind != ScopedKind.None && typeInfo.RefKind != RefKind.Out) 433case RefKind.Out: 460RefKind.Out => Token(SyntaxKind.OutKeyword),
VariableDeclarations.cs (1)
27if (info.RefKind == RefKind.Out)
Microsoft.VisualStudio.LanguageServices (2)
ChangeSignature\ChangeSignatureDialogViewModel.ParameterViewModels.cs (1)
192case RefKind.Out:
Progression\GraphBuilder.cs (1)
317node.SetValue<bool>(Properties.IsOut, parameterSymbol.RefKind == RefKind.Out);
Microsoft.VisualStudio.LanguageServices.CSharp (2)
CodeModel\CSharpCodeModelService_Prototype.cs (1)
532else if (parameter.RefKind == RefKind.Out)
ObjectBrowser\DescriptionBuilder.cs (1)
431else if (current.RefKind == RefKind.Out)
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
ChangeSignature\ChangeSignatureViewModelTests.vb (1)
298Dim includedInTest = {RefKind.None, RefKind.Ref, RefKind.Out, RefKind.In, RefKind.RefReadOnly, RefKind.RefReadOnlyParameter}