Skip to content

Commit 92b7b24

Browse files
teo-tsirpanisSergio0694
authored andcommitted
Use .NET 9 SDK, update unit tests
1 parent d9e4541 commit 92b7b24

File tree

4 files changed

+31
-6
lines changed

4 files changed

+31
-6
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
4-
<LangVersion>12.0</LangVersion>
4+
<LangVersion>13.0</LangVersion>
55
<Nullable>enable</Nullable>
66
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
77

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"sdk": {
3-
"version": "8.0.100",
3+
"version": "9.0.100",
44
"rollForward": "latestFeature",
55
"allowPrerelease": false
66
}
7-
}
7+
}

tests/PolySharp.Tests/LanguageFeatures.cs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,18 @@ public static ReadOnlySpan<int> TestRange(ReadOnlySpan<int> numbers)
162162
[CollectionBuilder(typeof(CollectionClass), nameof(Create))]
163163
internal class CollectionClass : IEnumerable<int>
164164
{
165-
public CollectionClass Test()
165+
public static CollectionClass Test()
166166
{
167+
Test2(1, 2, 3);
168+
167169
return [1, 2, 3];
168170
}
169171

172+
public static void Test2(params CollectionClass collection)
173+
{
174+
175+
}
176+
170177
public static CollectionClass Create(ReadOnlySpan<int> values)
171178
{
172179
return new();
@@ -260,4 +267,22 @@ public void Start<TStateMachine>(ref TStateMachine stateMachine)
260267
}
261268
}
262269

263-
#endif
270+
#endif
271+
272+
internal static class OverloadResolutionPriorityTests
273+
{
274+
public static void Test()
275+
{
276+
TestOverload(1);
277+
}
278+
279+
[Obsolete("Do not use", error: true)]
280+
[OverloadResolutionPriority(-1)]
281+
public static void TestOverload(int x)
282+
{
283+
}
284+
285+
public static void TestOverload(int x, int y = 0)
286+
{
287+
}
288+
}

tests/PolySharp.Tests/PolySharp.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;net48;netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>net472;net48;netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
55
<PolySharpIncludeRuntimeSupportedAttributes>true</PolySharpIncludeRuntimeSupportedAttributes>
66
</PropertyGroup>
77

0 commit comments

Comments
 (0)