33 references to ERR_ExpressionTreeCantContainRefStruct
Microsoft.CodeAnalysis.CSharp (3)
Errors\ErrorFacts.cs (1)
1924
case ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
:
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
369
Error(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, node, type.Name);
538
_diagnostics.Add(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, p.Locations[0], p.Type.Name);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (4)
Semantics\PatternMatchingTests.cs (4)
10827
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "new ReadOnlySpan<char>(null)").WithArguments("ReadOnlySpan").WithLocation(7, 43),
10833
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "new Span<char>(null)").WithArguments("Span").WithLocation(8, 43));
10857
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "new ReadOnlySpan<char>(null)").WithArguments("ReadOnlySpan").WithLocation(7, 43),
10863
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)
1668
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "default(Struct1)").WithArguments("Struct1").WithLocation(8, 40));
1694
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "default").WithArguments("Struct1").WithLocation(8, 40));
1720
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "default").WithArguments("Struct1").WithLocation(8, 50));
1746
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "new Struct1()").WithArguments("Struct1").WithLocation(8, 40));
1773
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "s").WithArguments("Struct1").WithLocation(9, 25));
1819
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "default").WithArguments("TypedReference").WithLocation(8, 30));
1844
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "tr").WithArguments("TypedReference").WithLocation(9, 32));
Semantics\RefFieldTests.cs (12)
15582
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(11, 32),
15585
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "y").WithArguments("R").WithLocation(11, 44),
15588
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(11, 50),
15594
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(12, 32),
15597
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "y").WithArguments("R").WithLocation(12, 37),
15600
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(12, 43),
15624
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(18, 38),
15627
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "y").WithArguments("R").WithLocation(18, 50),
15630
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(18, 56),
15636
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(19, 38),
15639
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "y").WithArguments("R").WithLocation(19, 43),
15642
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, "x").WithArguments("R").WithLocation(19, 49),
Semantics\Utf8StringsLiteralsTests.cs (4)
1400
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, @"""hello""u8").WithArguments("ReadOnlySpan").WithLocation(8, 44)
1424
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, @"""h""u8 + ""ello""u8").WithArguments("ReadOnlySpan").WithLocation(8, 45),
1427
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, @"""h""u8").WithArguments("ReadOnlySpan").WithLocation(8, 45),
1430
Diagnostic(ErrorCode.
ERR_ExpressionTreeCantContainRefStruct
, @"""ello""u8").WithArguments("ReadOnlySpan").WithLocation(8, 53)