85 references to IsSymbolAccessibleWithin
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (1)
68!_typeSymbols.Compilation.IsSymbolAccessibleWithin(type, _typeSymbols.Compilation.Assembly) ||
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (5)
InteractiveSessionTests.cs (5)
492Assert.True(compilation2.IsSymbolAccessibleWithin(c2C1, c2C2)); 493Assert.True(compilation2.IsSymbolAccessibleWithin(c2C2, c2C1)); 494Assert.True(compilation2.IsSymbolAccessibleWithin(c2X, c2C2)); // access not enforced among submission symbols 502Assert.Throws<ArgumentException>(() => compilation2.IsSymbolAccessibleWithin(c3C3, c3C1)); 503Assert.True(compilation3.IsSymbolAccessibleWithin(c3C3, c3C1));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (65)
Semantics\AccessCheckTests.cs (65)
767Assert.Throws<ArgumentNullException>(() => { compilation.IsSymbolAccessibleWithin(classA, nullSymbol); }); 768Assert.Throws<ArgumentNullException>(() => { compilation.IsSymbolAccessibleWithin(nullSymbol, classA); }); 769Assert.Throws<ArgumentException>(() => { compilation.IsSymbolAccessibleWithin(classA, pubField); }); 772Assert.True(compilation.IsSymbolAccessibleWithin(classA, classB)); 774Assert.True(compilation.IsSymbolAccessibleWithin(aliasA, classB)); 776Assert.True(compilation.IsSymbolAccessibleWithin(pubField, classB)); 778Assert.False(compilation.IsSymbolAccessibleWithin(privField, classB)); 780Assert.False(compilation.IsSymbolAccessibleWithin(karrayType, classB)); 782Assert.True(compilation.IsSymbolAccessibleWithin(aarrayType, classB)); 784Assert.False(compilation.IsSymbolAccessibleWithin(kptrType, classB)); 786Assert.True(compilation.IsSymbolAccessibleWithin(aptrType, classB)); 788Assert.False(compilation.IsSymbolAccessibleWithin(kinreturnfuncptrType, classB)); 790Assert.False(compilation.IsSymbolAccessibleWithin(kinparamfuncptr1Type, classB)); 792Assert.False(compilation.IsSymbolAccessibleWithin(kinparamfuncptr2Type, classB)); 794Assert.True(compilation.IsSymbolAccessibleWithin(afuncptrType, classB)); 796Assert.False(compilation.IsSymbolAccessibleWithin(kdiscard, classB)); 798Assert.True(compilation.IsSymbolAccessibleWithin(adiscard, classB)); 800Assert.False(compilation.IsSymbolAccessibleWithin(kenumType, classB)); 802Assert.True(compilation.IsSymbolAccessibleWithin(aenumType, classB)); 804Assert.True(compilation.IsSymbolAccessibleWithin(unknownType, classB)); 806Assert.True(compilation.IsSymbolAccessibleWithin(globalNS, classB)); 808Assert.True(compilation.IsSymbolAccessibleWithin(protField, classA)); 810Assert.True(compilation.IsSymbolAccessibleWithin(protField, classA, classADerived)); 812Assert.False(compilation.IsSymbolAccessibleWithin(protField, classB)); 814Assert.False(compilation.IsSymbolAccessibleWithin(protField, classB, classADerived)); 816Assert.True(compilation.IsSymbolAccessibleWithin(protField, classA)); 818Assert.True(compilation.IsSymbolAccessibleWithin(protField, classADerived, classADerived)); 820Assert.False(compilation.IsSymbolAccessibleWithin(protField, classADerived, classADerived2)); 823Assert.True(compilation.IsSymbolAccessibleWithin(classA, sourceAssem)); 825Assert.True(compilation.IsSymbolAccessibleWithin(aliasA, sourceAssem)); 827Assert.True(compilation.IsSymbolAccessibleWithin(aarrayType, sourceAssem)); 829Assert.False(compilation.IsSymbolAccessibleWithin(karrayType, sourceAssem)); 831Assert.True(compilation.IsSymbolAccessibleWithin(aptrType, sourceAssem)); 833Assert.True(compilation.IsSymbolAccessibleWithin(afuncptrType, sourceAssem)); 835Assert.False(compilation.IsSymbolAccessibleWithin(kptrType, sourceAssem)); 837Assert.False(compilation.IsSymbolAccessibleWithin(kinreturnfuncptrType, sourceAssem)); 839Assert.False(compilation.IsSymbolAccessibleWithin(kinparamfuncptr1Type, sourceAssem)); 841Assert.False(compilation.IsSymbolAccessibleWithin(kinparamfuncptr2Type, sourceAssem)); 843Assert.True(compilation.IsSymbolAccessibleWithin(adiscard, sourceAssem)); 845Assert.False(compilation.IsSymbolAccessibleWithin(kdiscard, sourceAssem)); 847Assert.False(compilation.IsSymbolAccessibleWithin(classA, mscorlibAssem)); 849Assert.False(compilation.IsSymbolAccessibleWithin(aliasA, mscorlibAssem)); 851Assert.True(compilation.IsSymbolAccessibleWithin(unknownType, sourceAssem)); 853Assert.True(compilation.IsSymbolAccessibleWithin(mscorlibAssem, sourceAssem)); 861Assert.Throws<ArgumentException>(() => { compilation.IsSymbolAccessibleWithin(classA, classOther); }); 914Assert.True(compilation1.IsSymbolAccessibleWithin(SomeAlias, Outer)); 915Assert.True(compilation1.IsSymbolAccessibleWithin(Outer_Pointer.Type, Outer)); 916Assert.False(compilation1.IsSymbolAccessibleWithin(Outer_Pointer.Type, Other)); 917Assert.True(compilation1.IsSymbolAccessibleWithin(IntegerPlus, Other)); 918Assert.True(compilation1.IsSymbolAccessibleWithin(IntegerPlus, sourceAssem)); 919Assert.False(compilation1.IsSymbolAccessibleWithin(Private, Other)); 920Assert.False(compilation1.IsSymbolAccessibleWithin(Private, sourceAssem)); 921Assert.False(compilation1.IsSymbolAccessibleWithin(Outer_Inner_Field, Other)); 922Assert.False(compilation1.IsSymbolAccessibleWithin(Outer_Protected, Derived, Outer)); 923Assert.True(compilation1.IsSymbolAccessibleWithin(Outer_ProtectedInternal, Derived, Outer)); 924Assert.False(compilation1.IsSymbolAccessibleWithin(Outer_PrivateProtected, Derived, Outer)); 925Assert.True(compilation1.IsSymbolAccessibleWithin(Outer_Protected, Derived)); 926Assert.True(compilation1.IsSymbolAccessibleWithin(Outer_ProtectedInternal, Derived)); 927Assert.True(compilation1.IsSymbolAccessibleWithin(Outer_PrivateProtected, Derived)); 928Assert.False(compilation1.IsSymbolAccessibleWithin(Outer_Protected, sourceAssem)); 929Assert.True(compilation1.IsSymbolAccessibleWithin(Outer_Protected, Outer_Inner)); 945Assert.Throws<ArgumentException>(() => { compilation3.IsSymbolAccessibleWithin(Outer, InOtherCompilation); }); 946Assert.Throws<ArgumentException>(() => { compilation3.IsSymbolAccessibleWithin(Outer, InFriendCompilation); }); 961Assert.True(compilation.IsSymbolAccessibleWithin(classC, classQ)); 975Assert.Throws<ArgumentException>(() => compilation.IsSymbolAccessibleWithin(classC, classQ));
Microsoft.CodeAnalysis.UnitTests (8)
IsSymbolAccessibleWithinTests.cs (8)
34Assert.Throws<ArgumentException>(() => csc.IsSymbolAccessibleWithin(Av, Av)); 35Assert.Throws<ArgumentException>(() => csc.IsSymbolAccessibleWithin(Av, Ac)); 36Assert.Throws<ArgumentException>(() => csc.IsSymbolAccessibleWithin(Ac, Av)); 37Assert.Throws<ArgumentException>(() => csc.IsSymbolAccessibleWithin(Ac, Ac, Av)); 39Assert.Throws<ArgumentException>(() => vbc.IsSymbolAccessibleWithin(Ac, Ac)); 40Assert.Throws<ArgumentException>(() => vbc.IsSymbolAccessibleWithin(Ac, Av)); 41Assert.Throws<ArgumentException>(() => vbc.IsSymbolAccessibleWithin(Av, Ac)); 42Assert.Throws<ArgumentException>(() => vbc.IsSymbolAccessibleWithin(Av, Av, Ac));
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (5)
InteractiveSessionTests.vb (5)
137Assert.True(compilation2.IsSymbolAccessibleWithin(c2C1, c2C2)) 138Assert.True(compilation2.IsSymbolAccessibleWithin(c2C2, c2C1)) 139Assert.True(compilation2.IsSymbolAccessibleWithin(c2X, c2C2)) ' access not enforced among submission symbols 150Dim action As Action = Sub() compilation2.IsSymbolAccessibleWithin(c3C3, c3C1) 152Assert.True(compilation3.IsSymbolAccessibleWithin(c3C3, c3C1))
Microsoft.Extensions.Options.SourceGeneration (1)
Parser.cs (1)
473if (!_compilation.IsSymbolAccessibleWithin(attributeType, validatorType))