46 references to ERR_ExpressionTreeCantContainRefStruct
Microsoft.CodeAnalysis.CSharp (3)
Errors\ErrorFacts.cs (1)
1981
or ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
405
Error(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, node, type.Name);
625
_diagnostics.Add(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, p.GetFirstLocation(), p.Type.Name);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (17)
FirstClassSpanTests.cs (7)
5446
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "default").WithArguments(type).WithLocation(4, 15));
5469
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("Span").WithLocation(4, 5),
5472
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("Span").WithLocation(4, 14));
5501
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("Span").WithLocation(4, 5),
5504
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("Span").WithLocation(4, 14)
5537
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("ReadOnlySpan").WithLocation(4, 5),
5540
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("ReadOnlySpan").WithLocation(4, 14)
RefStructInterfacesTests.cs (4)
23264
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("T").WithLocation(7, 57),
23267
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "y").WithArguments("S").WithLocation(12, 54)
23305
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "M1()").WithArguments("T").WithLocation(7, 70),
23308
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "M2()").WithArguments("S").WithLocation(17, 70)
Semantics\ParamsCollectionTests.cs (2)
16545
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "M(s, s, s)").WithArguments("Span").WithLocation(5, 78),
16572
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "M(s, s, s)").WithArguments("Span").WithLocation(5, 78),
Semantics\PatternMatchingTests.cs (4)
10831
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "new ReadOnlySpan<char>(null)").WithArguments("ReadOnlySpan").WithLocation(7, 43),
10837
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "new Span<char>(null)").WithArguments("Span").WithLocation(8, 43));
10861
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "new ReadOnlySpan<char>(null)").WithArguments("ReadOnlySpan").WithLocation(7, 43),
10867
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "new Span<char>(null)").WithArguments("Span").WithLocation(8, 43));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (26)
Semantics\ArglistTests.cs (3)
140
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "__makeref(S)").WithArguments("TypedReference").WithLocation(8, 44),
149
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "default(TypedReference)").WithArguments("TypedReference").WithLocation(9, 52),
155
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "default(TypedReference)").WithArguments("TypedReference").WithLocation(10, 52),
Semantics\LambdaTests.cs (7)
1671
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "default(Struct1)").WithArguments("Struct1").WithLocation(8, 40));
1697
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "default").WithArguments("Struct1").WithLocation(8, 40));
1723
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "default").WithArguments("Struct1").WithLocation(8, 50));
1749
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "new Struct1()").WithArguments("Struct1").WithLocation(8, 40));
1776
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "s").WithArguments("Struct1").WithLocation(9, 25));
1822
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "default").WithArguments("TypedReference").WithLocation(8, 30));
1847
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "tr").WithArguments("TypedReference").WithLocation(9, 32));
Semantics\RefFieldTests.cs (12)
16142
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(11, 32),
16145
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "y").WithArguments("R").WithLocation(11, 44),
16148
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(11, 50),
16154
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(12, 32),
16157
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "y").WithArguments("R").WithLocation(12, 37),
16160
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(12, 43),
16184
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(18, 38),
16187
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "y").WithArguments("R").WithLocation(18, 50),
16190
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(18, 56),
16196
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(19, 38),
16199
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "y").WithArguments("R").WithLocation(19, 43),
16202
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(19, 49),
Semantics\Utf8StringsLiteralsTests.cs (4)
1401
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, @"""hello""u8").WithArguments("ReadOnlySpan").WithLocation(8, 44)
1425
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, @"""h""u8 + ""ello""u8").WithArguments("ReadOnlySpan").WithLocation(8, 45),
1428
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, @"""h""u8").WithArguments("ReadOnlySpan").WithLocation(8, 45),
1431
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, @"""ello""u8").WithArguments("ReadOnlySpan").WithLocation(8, 53)