78 references to ERR_RequiredMemberCannotBeLessVisibleThanContainingType
Microsoft.CodeAnalysis.CSharp (2)
Errors\ErrorFacts.cs (1)
2221
case ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
:
Symbols\Source\ModifierUtils.cs (1)
499
diagnostics.Add(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, errorLocation, symbol, symbol.ContainingType);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (76)
Symbols\RequiredMembersTests.cs (76)
966
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProtectedProperty").WithArguments("PublicClass.InternalProtectedProperty", "PublicClass").WithLocation(7, 37),
969
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProperty").WithArguments("PublicClass.InternalProperty", "PublicClass").WithLocation(8, 27),
972
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedProperty").WithArguments("PublicClass.ProtectedProperty", "PublicClass").WithLocation(9, 28),
975
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedProperty").WithArguments("PublicClass.PrivateProtectedProperty", "PublicClass").WithLocation(10, 36),
978
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProperty").WithArguments("PublicClass.PrivateProperty", "PublicClass").WithLocation(11, 26),
981
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProtectedField").WithArguments("PublicClass.InternalProtectedField", "PublicClass").WithLocation(13, 37),
984
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalField").WithArguments("PublicClass.InternalField", "PublicClass").WithLocation(14, 27),
987
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedField").WithArguments("PublicClass.ProtectedField", "PublicClass").WithLocation(15, 28),
990
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedField").WithArguments("PublicClass.PrivateProtectedField", "PublicClass").WithLocation(16, 36),
993
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateField").WithArguments("PublicClass.PrivateField", "PublicClass").WithLocation(17, 26),
996
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedProperty").WithArguments("InternalClass.ProtectedProperty", "InternalClass").WithLocation(24, 28),
999
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedProperty").WithArguments("InternalClass.PrivateProtectedProperty", "InternalClass").WithLocation(25, 36),
1002
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProperty").WithArguments("InternalClass.PrivateProperty", "InternalClass").WithLocation(26, 26),
1005
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedField").WithArguments("InternalClass.ProtectedField", "InternalClass").WithLocation(30, 28),
1008
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedField").WithArguments("InternalClass.PrivateProtectedField", "InternalClass").WithLocation(31, 36),
1011
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateField").WithArguments("InternalClass.PrivateField", "InternalClass").WithLocation(32, 26),
1014
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedProperty").WithArguments("Outer.ProtectedInternalClass.ProtectedProperty", "Outer.ProtectedInternalClass").WithLocation(41, 32),
1017
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedProperty").WithArguments("Outer.ProtectedInternalClass.PrivateProtectedProperty", "Outer.ProtectedInternalClass").WithLocation(42, 40),
1020
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProperty").WithArguments("Outer.ProtectedInternalClass.PrivateProperty", "Outer.ProtectedInternalClass").WithLocation(43, 30),
1023
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedField").WithArguments("Outer.ProtectedInternalClass.ProtectedField", "Outer.ProtectedInternalClass").WithLocation(47, 32),
1026
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedField").WithArguments("Outer.ProtectedInternalClass.PrivateProtectedField", "Outer.ProtectedInternalClass").WithLocation(48, 40),
1029
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateField").WithArguments("Outer.ProtectedInternalClass.PrivateField", "Outer.ProtectedInternalClass").WithLocation(49, 30),
1032
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedProperty").WithArguments("Outer.ProtectedClass.ProtectedProperty", "Outer.ProtectedClass").WithLocation(56, 32),
1035
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedProperty").WithArguments("Outer.ProtectedClass.PrivateProtectedProperty", "Outer.ProtectedClass").WithLocation(57, 40),
1038
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProperty").WithArguments("Outer.ProtectedClass.PrivateProperty", "Outer.ProtectedClass").WithLocation(58, 30),
1041
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedField").WithArguments("Outer.ProtectedClass.ProtectedField", "Outer.ProtectedClass").WithLocation(62, 32),
1044
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedField").WithArguments("Outer.ProtectedClass.PrivateProtectedField", "Outer.ProtectedClass").WithLocation(63, 40),
1047
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateField").WithArguments("Outer.ProtectedClass.PrivateField", "Outer.ProtectedClass").WithLocation(64, 30),
1050
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedProperty").WithArguments("Outer.PrivateProtectedClass.ProtectedProperty", "Outer.PrivateProtectedClass").WithLocation(71, 32),
1053
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedProperty").WithArguments("Outer.PrivateProtectedClass.PrivateProtectedProperty", "Outer.PrivateProtectedClass").WithLocation(72, 40),
1056
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProperty").WithArguments("Outer.PrivateProtectedClass.PrivateProperty", "Outer.PrivateProtectedClass").WithLocation(73, 30),
1059
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedField").WithArguments("Outer.PrivateProtectedClass.ProtectedField", "Outer.PrivateProtectedClass").WithLocation(77, 32),
1062
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedField").WithArguments("Outer.PrivateProtectedClass.PrivateProtectedField", "Outer.PrivateProtectedClass").WithLocation(78, 40),
1065
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateField").WithArguments("Outer.PrivateProtectedClass.PrivateField", "Outer.PrivateProtectedClass").WithLocation(79, 30),
1068
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedProperty").WithArguments("Outer.PrivateClass.ProtectedProperty", "Outer.PrivateClass").WithLocation(86, 32),
1071
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedProperty").WithArguments("Outer.PrivateClass.PrivateProtectedProperty", "Outer.PrivateClass").WithLocation(87, 40),
1074
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProperty").WithArguments("Outer.PrivateClass.PrivateProperty", "Outer.PrivateClass").WithLocation(88, 30),
1077
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedField").WithArguments("Outer.PrivateClass.ProtectedField", "Outer.PrivateClass").WithLocation(92, 32),
1080
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedField").WithArguments("Outer.PrivateClass.PrivateProtectedField", "Outer.PrivateClass").WithLocation(93, 40),
1083
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateField").WithArguments("Outer.PrivateClass.PrivateField", "Outer.PrivateClass").WithLocation(94, 30),
1086
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProtectedProperty").WithArguments("Outer2.ProtectedInternalClass2.InternalProtectedProperty", "Outer2.ProtectedInternalClass2").WithLocation(102, 41),
1089
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProperty").WithArguments("Outer2.ProtectedInternalClass2.InternalProperty", "Outer2.ProtectedInternalClass2").WithLocation(103, 31),
1092
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedProperty").WithArguments("Outer2.ProtectedInternalClass2.ProtectedProperty", "Outer2.ProtectedInternalClass2").WithLocation(104, 32),
1095
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedProperty").WithArguments("Outer2.ProtectedInternalClass2.PrivateProtectedProperty", "Outer2.ProtectedInternalClass2").WithLocation(105, 40),
1098
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProperty").WithArguments("Outer2.ProtectedInternalClass2.PrivateProperty", "Outer2.ProtectedInternalClass2").WithLocation(106, 30),
1101
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProtectedField").WithArguments("Outer2.ProtectedInternalClass2.InternalProtectedField", "Outer2.ProtectedInternalClass2").WithLocation(108, 41),
1104
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalField").WithArguments("Outer2.ProtectedInternalClass2.InternalField", "Outer2.ProtectedInternalClass2").WithLocation(109, 31),
1107
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "ProtectedField").WithArguments("Outer2.ProtectedInternalClass2.ProtectedField", "Outer2.ProtectedInternalClass2").WithLocation(110, 32),
1110
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtectedField").WithArguments("Outer2.ProtectedInternalClass2.PrivateProtectedField", "Outer2.ProtectedInternalClass2").WithLocation(111, 40),
1113
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateField").WithArguments("Outer2.ProtectedInternalClass2.PrivateField", "Outer2.ProtectedInternalClass2").WithLocation(112, 30)
1188
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProtected").WithArguments("PublicClass.InternalProtected", "PublicClass").WithLocation(4, 25),
1191
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Internal").WithArguments("PublicClass.Internal", "PublicClass").WithLocation(5, 25),
1194
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Protected").WithArguments("PublicClass.Protected", "PublicClass").WithLocation(6, 25),
1197
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtected").WithArguments("PublicClass.PrivateProtected", "PublicClass").WithLocation(7, 25),
1200
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Private").WithArguments("PublicClass.Private", "PublicClass").WithLocation(8, 25),
1203
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Protected").WithArguments("InternalClass.Protected", "InternalClass").WithLocation(14, 25),
1206
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtected").WithArguments("InternalClass.PrivateProtected", "InternalClass").WithLocation(15, 25),
1209
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Private").WithArguments("InternalClass.Private", "InternalClass").WithLocation(16, 25),
1212
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Protected").WithArguments("Outer.InternalProtectedClass.Protected", "Outer.InternalProtectedClass").WithLocation(24, 29),
1215
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtected").WithArguments("Outer.InternalProtectedClass.PrivateProtected", "Outer.InternalProtectedClass").WithLocation(25, 29),
1218
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Private").WithArguments("Outer.InternalProtectedClass.Private", "Outer.InternalProtectedClass").WithLocation(26, 29),
1221
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Protected").WithArguments("Outer.ProtectedClass.Protected", "Outer.ProtectedClass").WithLocation(32, 29),
1224
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtected").WithArguments("Outer.ProtectedClass.PrivateProtected", "Outer.ProtectedClass").WithLocation(33, 29),
1227
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Private").WithArguments("Outer.ProtectedClass.Private", "Outer.ProtectedClass").WithLocation(34, 29),
1230
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Protected").WithArguments("Outer.PrivateProtectedClass.Protected", "Outer.PrivateProtectedClass").WithLocation(40, 29),
1233
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtected").WithArguments("Outer.PrivateProtectedClass.PrivateProtected", "Outer.PrivateProtectedClass").WithLocation(41, 29),
1236
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Private").WithArguments("Outer.PrivateProtectedClass.Private", "Outer.PrivateProtectedClass").WithLocation(42, 29),
1239
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Protected").WithArguments("Outer.PrivateClass.Protected", "Outer.PrivateClass").WithLocation(48, 29),
1242
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtected").WithArguments("Outer.PrivateClass.PrivateProtected", "Outer.PrivateClass").WithLocation(49, 29),
1245
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Private").WithArguments("Outer.PrivateClass.Private", "Outer.PrivateClass").WithLocation(50, 29),
1248
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "InternalProtected").WithArguments("Outer2.InternalProtectedClass2.InternalProtected", "Outer2.InternalProtectedClass2").WithLocation(57, 29),
1251
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Internal").WithArguments("Outer2.InternalProtectedClass2.Internal", "Outer2.InternalProtectedClass2").WithLocation(58, 29),
1254
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Protected").WithArguments("Outer2.InternalProtectedClass2.Protected", "Outer2.InternalProtectedClass2").WithLocation(59, 29),
1257
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "PrivateProtected").WithArguments("Outer2.InternalProtectedClass2.PrivateProtected", "Outer2.InternalProtectedClass2").WithLocation(60, 29),
1260
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Private").WithArguments("Outer2.InternalProtectedClass2.Private", "Outer2.InternalProtectedClass2").WithLocation(61, 29)
1435
Diagnostic(ErrorCode.
ERR_RequiredMemberCannotBeLessVisibleThanContainingType
, "Prop2").WithArguments("C.Prop2", "C").WithLocation(6, 25)