Skip to content

Commit ea57ac8

Browse files
committed
update to .net 9
1 parent b8f060a commit ea57ac8

File tree

5 files changed

+22
-17
lines changed

5 files changed

+22
-17
lines changed

src/Equatable.Comparers/Equatable.Comparers.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>netstandard2.0;net6.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">

src/Equatable.Generator/Equatable.Generator.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>netstandard2.0;net6.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
55
<RootNamespace>Equatable</RootNamespace>
66
</PropertyGroup>
77

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
2-
// The .NET Foundation licenses this file to you under the MIT license.
3-
// See the LICENSE file in the project root for more information.
4-
51
using System.ComponentModel;
62

7-
// ReSharper disable once CheckNamespace
83
namespace System.Runtime.CompilerServices;
94

10-
/// <summary>
11-
/// Reserved to be used by the compiler for tracking metadata.
12-
/// This class should not be used by developers in source code.
13-
/// </summary>
145
[EditorBrowsable(EditorBrowsableState.Never)]
15-
internal static class IsExternalInit
16-
{
17-
}
6+
internal static class IsExternalInit;

src/Equatable.SourceGenerator/Models/EquatableArray.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,24 @@
44
namespace Equatable.SourceGenerator.Models;
55

66
[ExcludeFromCodeCoverage]
7-
public readonly struct EquatableArray<T>(T[] array) : IEquatable<EquatableArray<T>>, IEnumerable<T>
7+
public readonly struct EquatableArray<T> : IEquatable<EquatableArray<T>>, IEnumerable<T>
88
where T : IEquatable<T>
99
{
10-
public T[] Array { get; } = array ?? [];
10+
public static readonly EquatableArray<T> Empty = new();
11+
12+
13+
public EquatableArray() : this([]) { }
14+
15+
public EquatableArray(T[] array) => Array = array ?? [];
16+
17+
public EquatableArray(IEnumerable<T> items) => Array = items.ToArray() ?? [];
18+
19+
20+
public T[] Array { get; }
1121

1222
public int Count => Array.Length;
1323

24+
1425
public ReadOnlySpan<T> AsSpan() => Array.AsSpan();
1526

1627
public T[] AsArray() => Array;
@@ -44,4 +55,6 @@ public override int GetHashCode()
4455

4556

4657
public static implicit operator EquatableArray<T>(T[] array) => new(array);
58+
59+
public static implicit operator EquatableArray<T>(List<T> items) => new(items);
4760
}

test/Equatable.Entities/Equatable.Entities.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
55
<IsPackable>false</IsPackable>
66
<Nullable>enable</Nullable>
77
<LangVersion>latest</LangVersion>
8+
</PropertyGroup>
9+
10+
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
811
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
912
</PropertyGroup>
1013

0 commit comments

Comments
 (0)