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