32 references to ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
Microsoft.CodeAnalysis.CSharp (3)
Binder\Binder.cs (1)
778
: ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
,
Errors\ErrorFacts.cs (1)
2156
or ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
Errors\LazyUnmanagedCallersOnlyMethodCalledDiagnosticInfo.cs (1)
43
: ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
,
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (23)
CodeGen\CodeGenFunctionPointersTests.cs (23)
8061
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "C.M()").WithArguments("C.M()").WithLocation(6, 9)
8581
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "M1()", isSuppressed: false).WithArguments("C.M1()").WithLocation(10, 9),
8614
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "E.M1()", isSuppressed: false).WithArguments("D.M1()").WithLocation(8, 9),
8647
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "M1()", isSuppressed: false).WithArguments("D.M1()").WithLocation(8, 9),
8686
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "C.M1()").WithArguments("C.M1()").WithLocation(6, 9),
8737
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "C.M1()").WithArguments("C.M1()").WithLocation(6, 9)
9366
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "foreach").WithArguments("CExt.GetEnumerator(S)").WithLocation(7, 9)
9429
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "foreach (var i in s) {}").WithArguments("SEnumerator.Dispose()").WithLocation(7, 9),
9461
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "..s").WithArguments("SEnumerator.Dispose()").WithLocation(7, 24),
9558
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "s.Extension()").WithArguments("CExt.Extension(S)").WithLocation(8, 9),
9561
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "CExt.Extension(s)").WithArguments("CExt.Extension(S)").WithLocation(9, 9)
9592
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "s").WithArguments("CExt.Deconstruct(S, out int, out int)").WithLocation(9, 24),
9595
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "s").WithArguments("CExt.Deconstruct(S, out int, out int)").WithLocation(10, 20),
9598
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "ls").WithArguments("CExt.Deconstruct(S, out int, out int)").WithLocation(11, 32),
9601
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "(int _, int _)").WithArguments("CExt.Deconstruct(S, out int, out int)").WithLocation(12, 18),
9638
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "1").WithArguments("CExt.Add(S, int)").WithLocation(10, 23),
9641
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "2").WithArguments("CExt.Add(S, int)").WithLocation(10, 26),
9644
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "3").WithArguments("CExt.Add(S, int)").WithLocation(10, 29)
9677
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "await s").WithArguments("CExt.GetAwaiter(S)").WithLocation(8, 9)
9710
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "s").WithArguments("CExt.GetPinnableReference(S)").WithLocation(10, 29),
10032
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "F()").WithArguments("C.F()").WithLocation(7, 39),
10093
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "F()", isSuppressed: false).WithArguments("C.F()").WithLocation(12, 11),
10137
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "F()", isSuppressed: false).WithArguments("C.F(int)").WithLocation(7, 26),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Semantics\CollectionExpressionTests.cs (2)
19060
Diagnostic(ErrorCode.
ERR_UnmanagedCallersOnlyMethodsCannotBeCalledDirectly
, "[]").WithArguments("MyCollectionBuilder.Create<string>(System.ReadOnlySpan<string>)").WithLocation(6, 34),
19063
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)