Skip to content

Commit 1ed16d8

Browse files
committed
fix test
1 parent 2844012 commit 1ed16d8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

test/Thinktecture.Runtime.Extensions.SourceGenerator.Tests/SourceGeneratorTests/AdHocUnionSourceGeneratorTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,6 +1316,7 @@ public partial struct TestUnion;
13161316
.Which.GetMessage().Should().Be("TypeParamRef1 cannot be used on non-generic ad-hoc union 'TestUnion'");
13171317
}
13181318

1319+
#if NET9_0_OR_GREATER
13191320
[Fact]
13201321
public void Should_not_generate_when_type_parameter_allows_ref_struct()
13211322
{
@@ -1335,6 +1336,7 @@ public partial struct TestUnion<T> where T : allows ref struct;
13351336
result.GeneratorDiagnostics.Should().ContainSingle(d => d.Id == "TTRESG073")
13361337
.Which.GetMessage().Should().Be("Ad-hoc union 'TestUnion<T>' has type parameter 'T' with 'allows ref struct' which is not supported. Remove the 'allows ref struct' anti-constraint from the type parameter.");
13371338
}
1339+
#endif
13381340

13391341
[Fact]
13401342
public async Task Should_generate_with_warning_when_generic_type_does_not_use_TypeParamRef()

0 commit comments

Comments
 (0)