78 references to ERR_RequiredMemberCannotBeLessVisibleThanContainingType
Microsoft.CodeAnalysis.CSharp (2)
Errors\ErrorFacts.cs (1)
2277
or ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
Symbols\Source\ModifierUtils.cs (1)
524
diagnostics.Add(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, errorLocation, symbol, symbol.ContainingType);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (76)
Symbols\RequiredMembersTests.cs (76)
950
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProtectedProperty").WithArguments("PublicClass.InternalProtectedProperty", "PublicClass").WithLocation(7, 37),
953
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProperty").WithArguments("PublicClass.InternalProperty", "PublicClass").WithLocation(8, 27),
956
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedProperty").WithArguments("PublicClass.ProtectedProperty", "PublicClass").WithLocation(9, 28),
959
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedProperty").WithArguments("PublicClass.PrivateProtectedProperty", "PublicClass").WithLocation(10, 36),
962
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProperty").WithArguments("PublicClass.PrivateProperty", "PublicClass").WithLocation(11, 26),
965
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProtectedField").WithArguments("PublicClass.InternalProtectedField", "PublicClass").WithLocation(13, 37),
968
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalField").WithArguments("PublicClass.InternalField", "PublicClass").WithLocation(14, 27),
971
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedField").WithArguments("PublicClass.ProtectedField", "PublicClass").WithLocation(15, 28),
974
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedField").WithArguments("PublicClass.PrivateProtectedField", "PublicClass").WithLocation(16, 36),
977
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateField").WithArguments("PublicClass.PrivateField", "PublicClass").WithLocation(17, 26),
980
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedProperty").WithArguments("InternalClass.ProtectedProperty", "InternalClass").WithLocation(24, 28),
983
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedProperty").WithArguments("InternalClass.PrivateProtectedProperty", "InternalClass").WithLocation(25, 36),
986
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProperty").WithArguments("InternalClass.PrivateProperty", "InternalClass").WithLocation(26, 26),
989
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedField").WithArguments("InternalClass.ProtectedField", "InternalClass").WithLocation(30, 28),
992
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedField").WithArguments("InternalClass.PrivateProtectedField", "InternalClass").WithLocation(31, 36),
995
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateField").WithArguments("InternalClass.PrivateField", "InternalClass").WithLocation(32, 26),
998
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedProperty").WithArguments("Outer.ProtectedInternalClass.ProtectedProperty", "Outer.ProtectedInternalClass").WithLocation(41, 32),
1001
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedProperty").WithArguments("Outer.ProtectedInternalClass.PrivateProtectedProperty", "Outer.ProtectedInternalClass").WithLocation(42, 40),
1004
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProperty").WithArguments("Outer.ProtectedInternalClass.PrivateProperty", "Outer.ProtectedInternalClass").WithLocation(43, 30),
1007
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedField").WithArguments("Outer.ProtectedInternalClass.ProtectedField", "Outer.ProtectedInternalClass").WithLocation(47, 32),
1010
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedField").WithArguments("Outer.ProtectedInternalClass.PrivateProtectedField", "Outer.ProtectedInternalClass").WithLocation(48, 40),
1013
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateField").WithArguments("Outer.ProtectedInternalClass.PrivateField", "Outer.ProtectedInternalClass").WithLocation(49, 30),
1016
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedProperty").WithArguments("Outer.ProtectedClass.ProtectedProperty", "Outer.ProtectedClass").WithLocation(56, 32),
1019
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedProperty").WithArguments("Outer.ProtectedClass.PrivateProtectedProperty", "Outer.ProtectedClass").WithLocation(57, 40),
1022
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProperty").WithArguments("Outer.ProtectedClass.PrivateProperty", "Outer.ProtectedClass").WithLocation(58, 30),
1025
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedField").WithArguments("Outer.ProtectedClass.ProtectedField", "Outer.ProtectedClass").WithLocation(62, 32),
1028
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedField").WithArguments("Outer.ProtectedClass.PrivateProtectedField", "Outer.ProtectedClass").WithLocation(63, 40),
1031
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateField").WithArguments("Outer.ProtectedClass.PrivateField", "Outer.ProtectedClass").WithLocation(64, 30),
1034
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedProperty").WithArguments("Outer.PrivateProtectedClass.ProtectedProperty", "Outer.PrivateProtectedClass").WithLocation(71, 32),
1037
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedProperty").WithArguments("Outer.PrivateProtectedClass.PrivateProtectedProperty", "Outer.PrivateProtectedClass").WithLocation(72, 40),
1040
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProperty").WithArguments("Outer.PrivateProtectedClass.PrivateProperty", "Outer.PrivateProtectedClass").WithLocation(73, 30),
1043
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedField").WithArguments("Outer.PrivateProtectedClass.ProtectedField", "Outer.PrivateProtectedClass").WithLocation(77, 32),
1046
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedField").WithArguments("Outer.PrivateProtectedClass.PrivateProtectedField", "Outer.PrivateProtectedClass").WithLocation(78, 40),
1049
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateField").WithArguments("Outer.PrivateProtectedClass.PrivateField", "Outer.PrivateProtectedClass").WithLocation(79, 30),
1052
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedProperty").WithArguments("Outer.PrivateClass.ProtectedProperty", "Outer.PrivateClass").WithLocation(86, 32),
1055
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedProperty").WithArguments("Outer.PrivateClass.PrivateProtectedProperty", "Outer.PrivateClass").WithLocation(87, 40),
1058
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProperty").WithArguments("Outer.PrivateClass.PrivateProperty", "Outer.PrivateClass").WithLocation(88, 30),
1061
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedField").WithArguments("Outer.PrivateClass.ProtectedField", "Outer.PrivateClass").WithLocation(92, 32),
1064
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedField").WithArguments("Outer.PrivateClass.PrivateProtectedField", "Outer.PrivateClass").WithLocation(93, 40),
1067
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateField").WithArguments("Outer.PrivateClass.PrivateField", "Outer.PrivateClass").WithLocation(94, 30),
1070
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProtectedProperty").WithArguments("Outer2.ProtectedInternalClass2.InternalProtectedProperty", "Outer2.ProtectedInternalClass2").WithLocation(102, 41),
1073
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProperty").WithArguments("Outer2.ProtectedInternalClass2.InternalProperty", "Outer2.ProtectedInternalClass2").WithLocation(103, 31),
1076
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedProperty").WithArguments("Outer2.ProtectedInternalClass2.ProtectedProperty", "Outer2.ProtectedInternalClass2").WithLocation(104, 32),
1079
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedProperty").WithArguments("Outer2.ProtectedInternalClass2.PrivateProtectedProperty", "Outer2.ProtectedInternalClass2").WithLocation(105, 40),
1082
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProperty").WithArguments("Outer2.ProtectedInternalClass2.PrivateProperty", "Outer2.ProtectedInternalClass2").WithLocation(106, 30),
1085
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProtectedField").WithArguments("Outer2.ProtectedInternalClass2.InternalProtectedField", "Outer2.ProtectedInternalClass2").WithLocation(108, 41),
1088
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalField").WithArguments("Outer2.ProtectedInternalClass2.InternalField", "Outer2.ProtectedInternalClass2").WithLocation(109, 31),
1091
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedField").WithArguments("Outer2.ProtectedInternalClass2.ProtectedField", "Outer2.ProtectedInternalClass2").WithLocation(110, 32),
1094
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedField").WithArguments("Outer2.ProtectedInternalClass2.PrivateProtectedField", "Outer2.ProtectedInternalClass2").WithLocation(111, 40),
1097
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateField").WithArguments("Outer2.ProtectedInternalClass2.PrivateField", "Outer2.ProtectedInternalClass2").WithLocation(112, 30)
1172
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProtected").WithArguments("PublicClass.InternalProtected", "PublicClass").WithLocation(4, 25),
1175
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Internal").WithArguments("PublicClass.Internal", "PublicClass").WithLocation(5, 25),
1178
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Protected").WithArguments("PublicClass.Protected", "PublicClass").WithLocation(6, 25),
1181
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtected").WithArguments("PublicClass.PrivateProtected", "PublicClass").WithLocation(7, 25),
1184
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Private").WithArguments("PublicClass.Private", "PublicClass").WithLocation(8, 25),
1187
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Protected").WithArguments("InternalClass.Protected", "InternalClass").WithLocation(14, 25),
1190
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtected").WithArguments("InternalClass.PrivateProtected", "InternalClass").WithLocation(15, 25),
1193
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Private").WithArguments("InternalClass.Private", "InternalClass").WithLocation(16, 25),
1196
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Protected").WithArguments("Outer.InternalProtectedClass.Protected", "Outer.InternalProtectedClass").WithLocation(24, 29),
1199
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtected").WithArguments("Outer.InternalProtectedClass.PrivateProtected", "Outer.InternalProtectedClass").WithLocation(25, 29),
1202
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Private").WithArguments("Outer.InternalProtectedClass.Private", "Outer.InternalProtectedClass").WithLocation(26, 29),
1205
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Protected").WithArguments("Outer.ProtectedClass.Protected", "Outer.ProtectedClass").WithLocation(32, 29),
1208
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtected").WithArguments("Outer.ProtectedClass.PrivateProtected", "Outer.ProtectedClass").WithLocation(33, 29),
1211
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Private").WithArguments("Outer.ProtectedClass.Private", "Outer.ProtectedClass").WithLocation(34, 29),
1214
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Protected").WithArguments("Outer.PrivateProtectedClass.Protected", "Outer.PrivateProtectedClass").WithLocation(40, 29),
1217
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtected").WithArguments("Outer.PrivateProtectedClass.PrivateProtected", "Outer.PrivateProtectedClass").WithLocation(41, 29),
1220
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Private").WithArguments("Outer.PrivateProtectedClass.Private", "Outer.PrivateProtectedClass").WithLocation(42, 29),
1223
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Protected").WithArguments("Outer.PrivateClass.Protected", "Outer.PrivateClass").WithLocation(48, 29),
1226
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtected").WithArguments("Outer.PrivateClass.PrivateProtected", "Outer.PrivateClass").WithLocation(49, 29),
1229
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Private").WithArguments("Outer.PrivateClass.Private", "Outer.PrivateClass").WithLocation(50, 29),
1232
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProtected").WithArguments("Outer2.InternalProtectedClass2.InternalProtected", "Outer2.InternalProtectedClass2").WithLocation(57, 29),
1235
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Internal").WithArguments("Outer2.InternalProtectedClass2.Internal", "Outer2.InternalProtectedClass2").WithLocation(58, 29),
1238
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Protected").WithArguments("Outer2.InternalProtectedClass2.Protected", "Outer2.InternalProtectedClass2").WithLocation(59, 29),
1241
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtected").WithArguments("Outer2.InternalProtectedClass2.PrivateProtected", "Outer2.InternalProtectedClass2").WithLocation(60, 29),
1244
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Private").WithArguments("Outer2.InternalProtectedClass2.Private", "Outer2.InternalProtectedClass2").WithLocation(61, 29)
1419
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Prop2").WithArguments("C.Prop2", "C").WithLocation(6, 25)