199 references to RefReadOnly
ILLink.RoslynAnalyzer (3)
Metrics (3)
Metrics.Legacy (3)
Microsoft.CodeAnalysis.Analyzers (3)
Microsoft.CodeAnalysis.AnalyzerUtilities (3)
Microsoft.CodeAnalysis.BannedApiAnalyzers (3)
Microsoft.CodeAnalysis.CodeStyle (4)
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.CSharp (56)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (20)
CodeGen\CodeGenReadonlyStructTests.cs (13)
1572verifyReadOnly(s1.GetMethod("M2"), true, RefKind.RefReadOnly);
1574verifyReadOnly(s1.GetProperty("P1").GetMethod, true, RefKind.RefReadOnly);
1577verifyReadOnly(s1.GetProperty("P2").GetMethod, true, RefKind.RefReadOnly);
1579verifyReadOnly(s1.GetProperty("P3").GetMethod, true, RefKind.RefReadOnly);
1583verifyReadOnly(s1.GetProperty("P4").SetMethod, true, RefKind.RefReadOnly);
1588verifyReadOnly(s1.GetEvent("E").AddMethod, true, RefKind.RefReadOnly);
1589verifyReadOnly(s1.GetEvent("E").RemoveMethod, true, RefKind.RefReadOnly);
1593verifyReadOnly(s2.GetMethod("M1"), true, RefKind.RefReadOnly);
1595verifyReadOnly(s2.GetProperty("P1").GetMethod, true, RefKind.RefReadOnly);
1596verifyReadOnly(s2.GetProperty("P2").GetMethod, true, RefKind.RefReadOnly);
1597verifyReadOnly(s2.GetProperty("P3").SetMethod, true, RefKind.RefReadOnly);
1602verifyReadOnly(s2.GetEvent("E").AddMethod, true, RefKind.RefReadOnly);
1603verifyReadOnly(s2.GetEvent("E").RemoveMethod, true, RefKind.RefReadOnly);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (22)
Attributes\AttributeTests_RefReadOnly.cs (22)
38Assert.Equal(RefKind.RefReadOnly, method.RefKind);
92Assert.Equal(RefKind.RefReadOnly, method.RefKind);
120Assert.Equal(RefKind.RefReadOnly, method.RefKind);
310Assert.Equal(RefKind.RefReadOnly, property.RefKind);
339Assert.Equal(RefKind.RefReadOnly, property.RefKind);
376Assert.Equal(RefKind.RefReadOnly, property.RefKind);
402Assert.Equal(RefKind.RefReadOnly, indexer.RefKind);
446Assert.Equal(RefKind.RefReadOnly, indexer.RefKind);
474Assert.Equal(RefKind.RefReadOnly, indexer.RefKind);
501Assert.Equal(RefKind.RefReadOnly, method.RefKind);
537Assert.Equal(RefKind.RefReadOnly, method.RefKind);
561Assert.Equal(RefKind.RefReadOnly, method.RefKind);
598Assert.Equal(RefKind.RefReadOnly, method.RefKind);
652Assert.Equal(RefKind.RefReadOnly, method.RefKind);
686Assert.Equal(RefKind.RefReadOnly, method.RefKind);
725Assert.Equal(RefKind.RefReadOnly, method.RefKind);
784Assert.Equal(RefKind.RefReadOnly, method.RefKind);
819Assert.Equal(RefKind.RefReadOnly, method.RefKind);
2346Assert.Equal(RefKind.RefReadOnly, method.RefKind);
2370Assert.Equal(RefKind.RefReadOnly, method.Parameters[0].RefKind);
2393Assert.Equal(RefKind.RefReadOnly, method.RefKind);
2418Assert.Equal(RefKind.RefReadOnly, method.Parameters[1].RefKind);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (13)
Semantics\RefFieldTests.cs (13)
148VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F2"), "ref readonly T S<T>.F2", RefKind.RefReadOnly, new string[0]);
154VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F2"), "ref readonly T S<T>.F2", RefKind.RefReadOnly, new string[0]);
242VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.RefReadOnly, new string[0]);
247VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.RefReadOnly, new string[0]);
283VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.RefReadOnly, new string[0]);
293VerifyFieldSymbol(comp.GetMember<FieldSymbol>("S.F"), "ref readonly T S<T>.F", RefKind.RefReadOnly, new string[0]);
345VerifyFieldSymbol(field, "ref readonly System.Int32 A.F", RefKind.RefReadOnly, new string[0]);
12071VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.RefReadOnly, ScopedKind.ScopedRef);
12074VerifyLocalSymbol(locals[5], "scoped ref readonly R r51", RefKind.RefReadOnly, ScopedKind.ScopedRef);
12208VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.RefReadOnly, ScopedKind.ScopedRef);
14608VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.RefReadOnly, ScopedKind.ScopedRef);
27607VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.RefReadOnly, ScopedKind.ScopedRef);
27697VerifyLocalSymbol(locals[2], "scoped ref readonly R r5", RefKind.RefReadOnly, ScopedKind.ScopedRef);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (17)
Symbols\FunctionPointerTypeSymbolTests.cs (7)
28[InlineData("ref readonly", RefKind.RefReadOnly,
116verifyRefKind(RefKind.RefReadOnly, mParams[3]);
200Assert.Equal(RefKind.RefReadOnly, secondSignature.RefKind);
1584RefKind.RefReadOnly,
1619RefKind.RefReadOnly,
1640ptr = comp.CreateFunctionPointerTypeSymbol(@string, returnRefKind: RefKind.RefReadOnly, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, convention);
1655ptr = comp.CreateFunctionPointerTypeSymbol(@string, returnRefKind: RefKind.RefReadOnly, parameterTypes: ImmutableArray<ITypeSymbol>.Empty, parameterRefKinds: ImmutableArray<RefKind>.Empty, SignatureCallingConvention.Unmanaged, ImmutableArray.Create(cdeclType, stdcallType)!);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
Microsoft.CodeAnalysis.Features (1)
Microsoft.CodeAnalysis.ResxSourceGenerator (3)
Microsoft.CodeAnalysis.Workspaces (6)
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Roslyn.Diagnostics.Analyzers (21)
AbstractDoNotCopyValue.cs (17)
577case RefKind.Ref or RefKind.RefReadOnly or RefKindEx.RefReadOnlyParameter when operation.Conversion.IsIdentity:
1356(RefKind.Ref, RefKind.Ref or RefKind.RefReadOnly or RefKindEx.RefReadOnlyParameter) => true,
1357(RefKind.RefReadOnly or RefKindEx.RefReadOnlyParameter, RefKind.RefReadOnly or RefKindEx.RefReadOnlyParameter) => true,
1365return RefKind.RefReadOnly;
1390{ ReturnsByRefReadonly: true } => RefKind.RefReadOnly,
1400return field.IsReadOnly ? RefKind.RefReadOnly : RefKind.Ref;
1403return _context.OwningSymbol.IsReadOnly() ? RefKind.RefReadOnly : RefKind.Ref;
1408{ ReturnsByRefReadonly: true } => RefKind.RefReadOnly,
1418return local.RefKind == RefKind.RefReadOnly ? RefKind.RefReadOnly : RefKind.Ref;
1434{ ReturnsByRefReadonly: true } => RefKind.RefReadOnly,
1446return RefKind.RefReadOnly;
1454(RefKind.RefReadOnly or RefKindEx.RefReadOnlyParameter, _) => RefKind.RefReadOnly,
1455(_, RefKind.RefReadOnly or RefKindEx.RefReadOnlyParameter) => RefKind.RefReadOnly,
Roslyn.Diagnostics.CSharp.Analyzers (1)
Test.Utilities (3)
Text.Analyzers (3)