84 references to ERR_NotRefStructConstraintNotSatisfied
Microsoft.CodeAnalysis.CSharp (2)
Errors\ErrorFacts.cs (1)
2458
or ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
Symbols\ConstraintsHelper.cs (1)
986
diagnosticsBuilder.Add(new TypeParameterDiagnosticInfo(typeParameter, new UseSiteInfo<AssemblySymbol>(new CSDiagnosticInfo(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, containingSymbol.ConstructedFrom(), typeParameter, typeArgument.Type))));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (6)
CodeGen\CodeGenAsyncIteratorTests.cs (2)
653
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "M").WithArguments("System.Collections.Generic.IAsyncEnumerable<T>", "T", "S").WithLocation(4, 65),
669
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "M").WithArguments("System.Collections.Generic.IAsyncEnumerable<T>", "T", "S").WithLocation(4, 65),
CodeGen\CodeGenNullCoalescingAssignmentTests.cs (1)
2714
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "Span<byte>?").WithArguments("System.Nullable<T>", "T", "System.Span<byte>").WithLocation(9, 9)
CodeGen\CodeGenTupleEqualityTests.cs (3)
1947
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "s1").WithArguments("(T1, T2)", "T2", "S").WithLocation(6, 35),
1953
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "s1").WithArguments("(T1, T2)", "T2", "S").WithLocation(6, 35),
1956
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "s2").WithArguments("(T1, T2)", "T2", "S").WithLocation(6, 49)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (18)
FirstClassSpanTests.cs (3)
4046
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "M1").WithArguments("System.Nullable<T>", "T", "System.Span<string>").WithLocation(5, 19),
4049
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "M2").WithArguments("System.Nullable<T>", "T", "System.ReadOnlySpan<string>").WithLocation(6, 27));
5646
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "M").WithArguments("I<T>", "T", "System.ReadOnlySpan<object>").WithLocation(5, 29),
RefStructInterfacesTests.cs (9)
5941
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "Test").WithArguments("C.Test<T>(T)", "T", "S1").WithLocation(19, 9),
5944
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "Test").WithArguments("C.Test<T>(T)", "T", "T2").WithLocation(24, 9)
20006
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "Test").WithArguments("C.Test<T>(T)", "T", "S1").WithLocation(10, 9)
20142
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "Test2").WithArguments("C.Test2<T>(T)", "T", "T").WithLocation(10, 9),
20145
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "Test2<T>").WithArguments("C.Test2<T>(T)", "T", "T").WithLocation(11, 9)
20234
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "S1").WithArguments("C<T, S>", "S", "S1").WithLocation(12, 26),
20237
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "T").WithArguments("C<T, S>", "S", "T").WithLocation(16, 25)
20263
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "T").WithLocation(10, 29)
21782
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "new T()").WithArguments("System.Activator.CreateInstance<T>()", "T", "T").WithLocation(7, 13)
Semantics\InlineArrayTests.cs (6)
16540
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "System.ReadOnlySpan<int>").WithLocation(13, 45),
16546
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "System.Span<int>").WithLocation(20, 37)
16627
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "System.ReadOnlySpan<int>").WithLocation(13, 45),
16633
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "x").WithArguments("System.Nullable<T>", "T", "System.Span<int>").WithLocation(20, 37)
23135
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "System.Span<int>?").WithArguments("System.Nullable<T>", "T", "System.Span<int>").WithLocation(7, 37),
23138
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "System.Span<int>?").WithArguments("System.Nullable<T>", "T", "System.Span<int>").WithLocation(12, 36)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (58)
Semantics\BetterCandidates.cs (1)
919
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "M").WithArguments("Program.M<T>(T, int)", "T", "A").WithLocation(5, 9)
Semantics\IndexAndRangeTests.cs (1)
245
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "Throws").WithArguments("C.Throws<T>(System.Func<T>)", "T", "System.Span<char>").WithLocation(9, 9)
Semantics\InterpolationTests.cs (2)
3667
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "{s}").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted<T>(T, int, string)", "T", "S").WithLocation(6, 5 + expression.Length)
4110
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "{s}").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted<T>(T)", "T", "S").WithLocation(5, 21)
Semantics\NullConditionalAssignmentTests.cs (1)
550
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "RS?").WithArguments("System.Nullable<T>", "T", "RS").WithLocation(13, 9),
Semantics\OverloadResolutionTests.cs (8)
11311
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "M1").WithArguments("Program.M1<T>(in T, in T)", "T", "Program.RefLike").WithLocation(19, 9),
11314
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "M1").WithArguments("Program.M1<T>(in T, in T)", "T", "Program.RefLike").WithLocation(20, 9),
11403
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "default(RefLike)").WithArguments("(T1, T2)", "T2", "Program.RefLike").WithLocation(17, 31),
11409
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "rl").WithArguments("(T1, T2)", "T1", "Program.RefLike").WithLocation(19, 17),
11412
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "rl").WithArguments("(T1, T2)", "T2", "Program.RefLike").WithLocation(19, 21),
11415
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "Method").WithArguments("Program.Method<T>(in (T arg1, T arg2))", "T", "Program.RefLike").WithLocation(19, 9),
11418
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "rl").WithArguments("(T1, T2)", "T1", "Program.RefLike").WithLocation(20, 20),
11421
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "rl").WithArguments("(T1, T2)", "T2", "Program.RefLike").WithLocation(20, 24),
Semantics\RawInterpolationTests_Handler.cs (3)
2033
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "{s}").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted<T>(T, int, string)", "T", "S").WithLocation(6, 26));
2043
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "{s}").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted<T>(T, int, string)", "T", "S").WithLocation(6, 16));
2511
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "{s}").WithArguments("System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted<T>(T)", "T", "S").WithLocation(5, 23)
Semantics\RefEscapingTests.cs (26)
5703
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "global").WithArguments("(T1, T2)", "T1", "System.Span<int>").WithLocation(8, 19),
5706
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "global").WithArguments("(T1, T2)", "T2", "System.Span<int>").WithLocation(8, 27)
5759
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "local").WithArguments("(T1, T2)", "T1", "System.Span<int>").WithLocation(12, 29),
5762
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "local").WithArguments("(T1, T2)", "T2", "System.Span<int>").WithLocation(12, 36),
5765
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "local").WithArguments("(T1, T2)", "T1", "System.Span<int>").WithLocation(14, 24),
5768
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "local").WithArguments("(T1, T2)", "T1", "System.Span<int>").WithLocation(15, 24),
5771
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "global").WithArguments("(T1, T2)", "T1", "System.Span<int>").WithLocation(17, 23),
5774
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "global").WithArguments("(T1, T2)", "T1", "System.Span<int>").WithLocation(18, 23),
5777
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "local").WithArguments("(T1, T2)", "T1", "System.Span<int>").WithLocation(20, 19)
5847
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "local").WithArguments("(, )", "", "System.Span<int>").WithLocation(12, 29),
5850
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "local").WithArguments("(, )", "", "System.Span<int>").WithLocation(12, 36),
5856
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "local").WithArguments("(, )", "", "System.Span<int>").WithLocation(14, 24),
5865
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "global").WithArguments("(, )", "", "System.Span<int>").WithLocation(17, 23),
5874
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "local").WithArguments("(, )", "", "System.Span<int>").WithLocation(20, 19),
5959
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "local").WithArguments("(T1, T2)", "T1", "System.Span<int>").WithLocation(12, 29),
5962
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "local").WithArguments("(T1, T2)", "T2", "System.Span<int>").WithLocation(12, 36),
5965
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "local").WithArguments("(T1, T2)", "T1", "System.Span<int>").WithLocation(14, 24),
5968
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "local").WithArguments("(T1, T2)", "T1", "System.Span<int>").WithLocation(15, 24),
5971
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "global").WithArguments("(T1, T2)", "T1", "System.Span<int>").WithLocation(17, 23),
5974
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "global").WithArguments("(T1, T2)", "T1", "System.Span<int>").WithLocation(18, 23),
5977
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "local").WithArguments("(T1, T2)", "T1", "System.Span<int>").WithLocation(20, 19)
6909
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "t").WithArguments("System.Threading.Tasks.Task<TResult>", "TResult", "S").WithLocation(8, 26),
6926
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "t").WithArguments("System.Threading.Tasks.Task<TResult>", "TResult", "S").WithLocation(8, 26),
6943
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "t").WithArguments("System.Threading.Tasks.Task<TResult>", "TResult", "S").WithLocation(8, 26),
7003
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "S?").WithArguments("System.Nullable<T>", "T", "S").WithLocation(8, 14),
7006
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "S?").WithArguments("System.Nullable<T>", "T", "S").WithLocation(10, 18)
Semantics\RefFieldTests.cs (4)
9481
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "y").WithArguments("(T1, T2)", "T1", "System.Span<int>").WithLocation(8, 19),
9484
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "x").WithArguments("(T1, T2)", "T2", "System.Span<int>").WithLocation(8, 22)
10273
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "M<StructWithRefField>").WithArguments("C.M<T>()", "T", "StructWithRefField").WithLocation(5, 7)
10312
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "M<StructWithIndirectRefField>").WithArguments("C.M<T>()", "T", "StructWithIndirectRefField").WithLocation(5, 7),
Semantics\SpanStackSafetyTests.cs (1)
449
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "Span<int>").WithArguments("System.Func<TResult>", "TResult", "System.Span<int>").WithLocation(10, 14),
Semantics\StackAllocInitializerTests.cs (7)
437
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "stackalloc[] { s }").WithArguments("System.Span<T>", "T", "Test.S").WithLocation(9, 34)
662
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "select stackalloc int[3] { 1, 2, 3 }").WithArguments("System.Linq.Enumerable.Select<TSource, TResult>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, TResult>)", "TResult", "System.Span<int>").WithLocation(7, 37),
668
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "select stackalloc int[ ] { 1, 2, 3 }").WithArguments("System.Linq.Enumerable.Select<TSource, TResult>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, TResult>)", "TResult", "System.Span<int>").WithLocation(8, 37),
674
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "select stackalloc [ ] { 1, 2, 3 }").WithArguments("System.Linq.Enumerable.Select<TSource, TResult>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, TResult>)", "TResult", "System.Span<int>").WithLocation(9, 37),
711
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "select v").WithArguments("System.Linq.Enumerable.Select<TSource, TResult>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, TResult>)", "TResult", "System.Span<int>").WithLocation(7, 75),
714
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "select v").WithArguments("System.Linq.Enumerable.Select<TSource, TResult>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, TResult>)", "TResult", "System.Span<int>").WithLocation(8, 75),
717
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "select v").WithArguments("System.Linq.Enumerable.Select<TSource, TResult>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource, TResult>)", "TResult", "System.Span<int>").WithLocation(9, 75)
Semantics\StackAllocSpanExpressionsTests.cs (3)
742
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "S").WithArguments("System.Span<T>", "T", "S").WithLocation(8, 14),
745
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "S[10]").WithArguments("System.Span<T>", "T", "S").WithLocation(9, 67),
748
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "S[100]").WithArguments("System.Span<T>", "T", "S").WithLocation(9, 86)
Semantics\Utf8StringsLiteralsTests.cs (1)
2438
Diagnostic(ErrorCode.
ERR_NotRefStructConstraintNotSatisfied
, "PrintType").WithArguments("C.PrintType<T>(T)", "T", "System.ReadOnlySpan<byte>").WithLocation(6, 9)