32 references to ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder.cs (1)
778
: ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
,
Errors\ErrorFacts.cs (1)
2154
or ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
Errors\LazyUnmanagedCallersOnlyMethodCalledDiagnosticInfo.cs (1)
43
: ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
,
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (23)
CodeGen\CodeGenFunctionPointersTests.cs (23)
8059
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "C.M()").WithArguments("C.M()").WithLocation(6, 9)
8579
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "M1()", isSuppressed: false).WithArguments("C.M1()").WithLocation(10, 9),
8612
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "E.M1()", isSuppressed: false).WithArguments("D.M1()").WithLocation(8, 9),
8645
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "M1()", isSuppressed: false).WithArguments("D.M1()").WithLocation(8, 9),
8684
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "C.M1()").WithArguments("C.M1()").WithLocation(6, 9),
8735
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "C.M1()").WithArguments("C.M1()").WithLocation(6, 9)
9364
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "foreach").WithArguments("CExt.GetEnumerator(S)").WithLocation(7, 9)
9427
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "foreach (var i in s) {}").WithArguments("SEnumerator.Dispose()").WithLocation(7, 9),
9459
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "..s").WithArguments("SEnumerator.Dispose()").WithLocation(7, 24),
9556
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "s.Extension()").WithArguments("CExt.Extension(S)").WithLocation(8, 9),
9559
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "CExt.Extension(s)").WithArguments("CExt.Extension(S)").WithLocation(9, 9)
9590
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "s").WithArguments("CExt.Deconstruct(S, out int, out int)").WithLocation(9, 24),
9593
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "s").WithArguments("CExt.Deconstruct(S, out int, out int)").WithLocation(10, 20),
9596
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "ls").WithArguments("CExt.Deconstruct(S, out int, out int)").WithLocation(11, 32),
9599
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "(int _, int _)").WithArguments("CExt.Deconstruct(S, out int, out int)").WithLocation(12, 18),
9636
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "1").WithArguments("CExt.Add(S, int)").WithLocation(10, 23),
9639
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "2").WithArguments("CExt.Add(S, int)").WithLocation(10, 26),
9642
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "3").WithArguments("CExt.Add(S, int)").WithLocation(10, 29)
9675
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "await s").WithArguments("CExt.GetAwaiter(S)").WithLocation(8, 9)
9708
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "s").WithArguments("CExt.GetPinnableReference(S)").WithLocation(10, 29),
10021
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "F()").WithArguments("C.F()").WithLocation(7, 39),
10082
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "F()", isSuppressed: false).WithArguments("C.F()").WithLocation(12, 11),
10126
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "F()", isSuppressed: false).WithArguments("C.F(int)").WithLocation(7, 26),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Semantics\CollectionExpressionTests.cs (2)
19063
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "[]").WithArguments("MyCollectionBuilder.Create<string>(System.ReadOnlySpan<string>)").WithLocation(6, 34),
19066
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "[1, 2, 3]").WithArguments("MyCollectionBuilder.Create<int>(System.ReadOnlySpan<int>)").WithLocation(7, 31),
Symbols\UserDefinedCompoundAssignmentOperatorsTests.cs (2)
5197
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "++x").WithArguments("C1.operator ++()").WithLocation(13, 9)
16610
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "x += 1").WithArguments("C1.operator +=(int)").WithLocation(13, 9)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Symbols\Retargeting\RetargetingTests.cs (2)
1069
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "C.M(1)").WithArguments("C.M(int)").WithLocation(1, 1)
1146
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "C.M(1)").WithArguments("C.M(int)").WithLocation(1, 1)