109 references to ERR_ObjectProhibited
Microsoft.CodeAnalysis.CSharp (5)
Binder\Binder_Conversions.cs (1)
2722
diagnostics.Add(ErrorCode.
ERR_ObjectProhibited
, node.Location, memberSymbol);
Binder\Binder_Expressions.cs (1)
9202
ErrorCode.
ERR_ObjectProhibited
;
Binder\Binder_Lookup.cs (1)
1575
diagInfo = diagnose ? new CSDiagnosticInfo(ErrorCode.
ERR_ObjectProhibited
, unwrappedSymbol) : null;
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (1)
683
: ErrorCode.
ERR_ObjectProhibited
;
Errors\ErrorFacts.cs (1)
759
or ErrorCode.
ERR_ObjectProhibited
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\UnsafeTests.cs (1)
5297
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "new Fixable(1)").WithArguments("Fixable.GetPinnableReference()").WithLocation(6, 25)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (16)
FlowAnalysis\RegionAnalysisTests.cs (2)
9438
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.M").WithArguments("C.M()").WithLocation(23, 24),
9441
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c.M").WithArguments("C.M()").WithLocation(29, 24)
PartialEventsAndConstructorsTests.cs (3)
2516
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c.F").WithArguments("C.F").WithLocation(4, 1),
2522
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.F").WithArguments("C.F").WithLocation(24, 13),
2537
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.F").WithArguments("C.F").WithLocation(39, 13));
Semantics\ExtensionTests.cs (3)
13756
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "new C().M").WithArguments("E.extension(C).M()").WithLocation(1, 1));
22394
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "new Fixable()").WithArguments("E.extension(Fixable).GetPinnableReference()").WithLocation(6, 25),
34298
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "o.M2").WithArguments("E.extension(object).M2()").WithLocation(7, 13));
Semantics\ExtensionTests2.cs (1)
2581
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "s2.M2").WithArguments("E.extension(string).M2()").WithLocation(5, 23));
Semantics\PatternMatchingTests_ListPatterns.cs (2)
1764
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "[42]").WithArguments("Test1.this[System.Index]").WithLocation(2, 38),
1767
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "new Test1()[0]").WithArguments("Test1.this[System.Index]").WithLocation(2, 44)
Semantics\PatternMatchingTests5.cs (3)
1877
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "Static").WithArguments("C.Static").WithLocation(2, 18),
1880
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "Static").WithArguments("C.Static").WithLocation(3, 27),
1883
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "Static").WithArguments("C.Static").WithLocation(4, 18)
Semantics\RecordTests.cs (2)
8521
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "X").WithArguments("C.X").WithLocation(9, 22)
15277
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "()", isSuppressed: false).WithArguments("C.Deconstruct()").WithLocation(8, 19),
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (22)
IOperation\IOperationTests_IDelegateCreationExpression.cs (1)
1081
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.M1").WithArguments("Program.M1()").WithLocation(7, 41)
IOperation\IOperationTests_IEventAssignmentExpression.cs (2)
327
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "t.MyEvent").WithArguments("Test.MyEvent").WithLocation(18, 19),
619
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "(c1 ?? c2).MyEvent").WithArguments("C.MyEvent").WithLocation(12, 9)
IOperation\IOperationTests_IEventReferenceOperation.cs (4)
109
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c.Event").WithArguments("C.Event").WithLocation(12, 19),
202
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c.Event").WithArguments("C.Event").WithLocation(11, 19)
433
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c1.Event1").WithArguments("C.Event1").WithLocation(12, 20),
436
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "(c1 ?? c2).Event1").WithArguments("C.Event1").WithLocation(13, 20)
IOperation\IOperationTests_IFieldReferenceExpression.cs (3)
362
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c.i").WithArguments("C.i").WithLocation(9, 28),
672
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c1.i").WithArguments("C.i").WithLocation(7, 14),
675
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "(c1 ?? c2).i").WithArguments("C.i").WithLocation(8, 14)
IOperation\IOperationTests_IInvocationOperation.cs (3)
39
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c.M1").WithArguments("C.M1()").WithLocation(9, 19)
617
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c1.M2").WithArguments("MyClass.M2(object)").WithLocation(6, 9),
620
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "(c1 ?? c2).M2").WithArguments("MyClass.M2(object)").WithLocation(7, 9)
IOperation\IOperationTests_IIsPatternExpression.cs (3)
1575
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "X").WithArguments("D.X").WithLocation(6, 32)
1620
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "X").WithArguments("D.X").WithLocation(6, 32)
1665
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "X").WithArguments("D.X").WithLocation(6, 32)
IOperation\IOperationTests_IMethodReferenceOperation.cs (2)
300
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c1.M1").WithArguments("C.M1()").WithLocation(7, 14),
303
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "(c1 ?? c2).M1").WithArguments("C.M1()").WithLocation(8, 14)
IOperation\IOperationTests_IPropertyReferenceExpression.cs (4)
77
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c.I").WithArguments("C.I").WithLocation(9, 28)
170
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c.list").WithArguments("C.list").WithLocation(11, 28)
587
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c1.P1").WithArguments("C.P1").WithLocation(7, 14),
590
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "(c1 ?? c2).P1").WithArguments("C.P1").WithLocation(8, 14)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (30)
Semantics\BetterCandidates.cs (2)
411
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "await x").WithArguments("MyTaskAwaiter<int>.GetResult()").WithLocation(9, 17)
416
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "await x").WithArguments("MyTaskAwaiter<int>.GetResult()").WithLocation(9, 17)
Semantics\BindingAwaitTests.cs (4)
2059
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "await new A()").WithArguments("Awaiter.IsCompleted")
2095
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "await new A()").WithArguments("Awaiter.IsCompleted")
2134
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "await new A()").WithArguments("Awaiter.IsCompleted")
2344
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "await new A()").WithArguments("Awaiter.GetResult()"));
Semantics\DeconstructionTests.cs (1)
1654
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "new C()").WithArguments("C.Deconstruct(out int, out string)").WithLocation(9, 28),
Semantics\DelegateTypeTests.cs (1)
1095
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.F").WithArguments("B.F(object)").WithLocation(5, 29)
Semantics\NullableReferenceTypesTests.cs (4)
123798
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c1.F").WithArguments("C<object>.F()").WithLocation(11, 9),
123804
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c2.F").WithArguments("C<object>.F()").WithLocation(14, 9));
142331
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "eq1.Equals").WithArguments("object.Equals(object, object)").WithLocation(16, 9),
142337
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.Equals").WithArguments("object.Equals(object, object)").WithLocation(19, 9));
Semantics\SemanticAnalyzerTests.cs (1)
518
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "p.StaticMethod").WithArguments("P.StaticMethod()").WithLocation(216, 9),
Semantics\SemanticErrorTests.cs (11)
1247
new ErrorDescription { Code = (int)ErrorCode.
ERR_ObjectProhibited
, Line = 9, Column = 9 },
1249
new ErrorDescription { Code = (int)ErrorCode.
ERR_ObjectProhibited
, Line = 9, Column = 18 }
3178
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "Prop.Privacy").WithArguments("ProtectionLevel.Privacy") // Extra In Roslyn
6729
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.Method").WithArguments("A.B.Method()").WithLocation(9, 13)
6753
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.field").WithArguments("C.field"),
6756
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.Property").WithArguments("C.Property"),
6759
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c.Property").WithArguments("C.Property"),
6762
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "c.field").WithArguments("C.field")
6785
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "t.F").WithArguments("A.F").WithLocation(9, 20),
6788
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "t.ReferenceEquals").WithArguments("object.ReferenceEquals(object, object)").WithLocation(10, 9),
6813
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "D.CreateDelegate").WithArguments("System.Delegate.CreateDelegate(System.Type, object, string)").WithLocation(9, 9)
Semantics\UnsafeTests.cs (6)
7753
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "p->StaticField").WithArguments("S.StaticField").WithLocation(26, 9),
7756
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "p->StaticProperty").WithArguments("S.StaticProperty").WithLocation(29, 9),
7759
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "p->StaticMethod").WithArguments("S.StaticMethod()").WithLocation(32, 9),
7762
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "p->StaticMethod").WithArguments("S.StaticMethod()").WithLocation(38, 13),
7804
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "p->StaticFieldLikeEvent").WithArguments("S.StaticFieldLikeEvent").WithLocation(16, 9),
7807
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "p->StaticCustomEvent").WithArguments("S.StaticCustomEvent").WithLocation(19, 9),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (35)
BadSymbolReference.cs (2)
636
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "y.Test1").WithArguments("CL3_C2.Test1()").WithLocation(177, 9),
717
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "y.Test1").WithArguments("CL3_C2.Test1()").WithLocation(177, 9),
Symbols\Source\PropertyTests.cs (1)
1098
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "a.Goo").WithArguments("A.Goo"));
Symbols\StaticAbstractMembersInInterfacesTests.cs (32)
8241
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.M01").WithArguments("I1.M01()").WithLocation(14, 9),
8244
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.M04").WithArguments("I1.M04()").WithLocation(15, 9),
8250
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.M01").WithArguments("I1.M01()").WithLocation(28, 9),
8253
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.M04").WithArguments("I1.M04()").WithLocation(30, 9),
12809
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.P01").WithArguments("I1.P01").WithLocation(14, 13),
12812
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.P04").WithArguments("I1.P04").WithLocation(15, 13),
12818
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.P01").WithArguments("I1.P01").WithLocation(28, 13),
12821
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.P04").WithArguments("I1.P04").WithLocation(30, 13),
12900
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.P01").WithArguments("I1.P01").WithLocation(14, 9),
12903
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.P04").WithArguments("I1.P04").WithLocation(15, 9),
12909
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.P01").WithArguments("I1.P01").WithLocation(28, 9),
12912
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.P04").WithArguments("I1.P04").WithLocation(30, 9),
12997
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.P01").WithArguments("I1.P01").WithLocation(14, 9),
13000
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.P04").WithArguments("I1.P04").WithLocation(15, 9),
13009
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.P01").WithArguments("I1.P01").WithLocation(28, 9),
13012
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.P04").WithArguments("I1.P04").WithLocation(30, 9),
13770
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.P01").WithArguments("I1.P01").WithLocation(14, 9),
13776
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.P04").WithArguments("I1.P04").WithLocation(15, 9),
13782
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.P01").WithArguments("I1.P01").WithLocation(28, 9),
13788
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.P04").WithArguments("I1.P04").WithLocation(30, 9),
13867
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.P01").WithArguments("I1.P01").WithLocation(14, 9),
13873
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.P04").WithArguments("I1.P04").WithLocation(15, 9),
13879
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.P01").WithArguments("I1.P01").WithLocation(28, 9),
13885
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.P04").WithArguments("I1.P04").WithLocation(30, 9),
14587
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.M01").WithArguments("I1.M01()").WithLocation(14, 28),
14590
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.M04").WithArguments("I1.M04()").WithLocation(15, 28),
14596
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.M01").WithArguments("I1.M01()").WithLocation(28, 28),
14599
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.M04").WithArguments("I1.M04()").WithLocation(30, 28),
15005
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.M01").WithArguments("I1.M01()").WithLocation(14, 31),
15008
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "this.M04").WithArguments("I1.M04()").WithLocation(15, 31),
15014
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.M01").WithArguments("I1.M01()").WithLocation(28, 31),
15017
Diagnostic(ErrorCode.
ERR_ObjectProhibited
, "x.M04").WithArguments("I1.M04()").WithLocation(30, 31),