mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-22 03:48:48 +00:00
Compare commits
2 Commits
027f6f23e1
...
b74bf60fe8
Author | SHA1 | Date | |
---|---|---|---|
b74bf60fe8 | |||
bdef9b1442 |
@ -20,8 +20,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
- X10D: Removed `DateOnly.Deconstruct` due to conflict with
|
||||||
|
[`System.DateOnly.Deconstruct`](https://learn.microsoft.com/en-us/dotnet/api/system.datetime.deconstruct?view=net-8.0).
|
||||||
- X10D: Removed `Span<T>.Split` for .NET 9.0 target due to conflicts with
|
- X10D: Removed `Span<T>.Split` for .NET 9.0 target due to conflicts with
|
||||||
[`System.MemoryExtensions.Split`](https://learn.microsoft.com/en-us/dotnet/api/system.memoryextensions.split?view=net-8.0).
|
[`System.MemoryExtensions.Split`](https://learn.microsoft.com/en-us/dotnet/api/system.memoryextensions.split?view=net-9.0).
|
||||||
|
|
||||||
## [4.0.0] - 2024-06-12
|
## [4.0.0] - 2024-06-12
|
||||||
|
|
||||||
|
@ -39,30 +39,6 @@ internal class DateOnlyTests
|
|||||||
Assert.That(age, Is.EqualTo(18));
|
Assert.That(age, Is.EqualTo(18));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void Deconstruct_ShouldDeconstruct_GivenDateOnly()
|
|
||||||
{
|
|
||||||
var date = new DateOnly(2017, 12, 31);
|
|
||||||
|
|
||||||
date.Deconstruct(out int year, out int month, out int day);
|
|
||||||
|
|
||||||
Assert.That(year, Is.EqualTo(2017));
|
|
||||||
Assert.That(month, Is.EqualTo(12));
|
|
||||||
Assert.That(day, Is.EqualTo(31));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void Deconstruct_ShouldDeconstructToTuple_GivenDateOnly()
|
|
||||||
{
|
|
||||||
var date = new DateOnly(2017, 12, 31);
|
|
||||||
|
|
||||||
(int year, int month, int day) = date;
|
|
||||||
|
|
||||||
Assert.That(year, Is.EqualTo(2017));
|
|
||||||
Assert.That(month, Is.EqualTo(12));
|
|
||||||
Assert.That(day, Is.EqualTo(31));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void First_ShouldBeSaturday_Given1Jan2000()
|
public void First_ShouldBeSaturday_Given1Jan2000()
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
using System.Buffers.Binary;
|
using System.Buffers.Binary;
|
||||||
using System.Diagnostics.Contracts;
|
using System.Diagnostics.Contracts;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace X10D.IO;
|
namespace X10D.IO;
|
||||||
|
|
||||||
|
@ -39,20 +39,6 @@ public static class DateOnlyExtensions
|
|||||||
return value.ToDateTime(default).Age(referenceDate.ToDateTime(default));
|
return value.ToDateTime(default).Age(referenceDate.ToDateTime(default));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Deconstructs the current <see cref="DateOnly" /> into its year, month, and day.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="value">The date to deconstruct.</param>
|
|
||||||
/// <param name="year">When this method returns, contains the year.</param>
|
|
||||||
/// <param name="month">When this method returns, contains the month.</param>
|
|
||||||
/// <param name="day">When this method returns, contains the day.</param>
|
|
||||||
public static void Deconstruct(this DateOnly value, out int year, out int month, out int day)
|
|
||||||
{
|
|
||||||
year = value.Year;
|
|
||||||
month = value.Month;
|
|
||||||
day = value.Day;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a date representing the first occurence of a specified day of the week in the current month.
|
/// Gets a date representing the first occurence of a specified day of the week in the current month.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -6,7 +6,7 @@ namespace SourceGenerator;
|
|||||||
|
|
||||||
public class OverloadSyntaxReceiver : ISyntaxReceiver
|
public class OverloadSyntaxReceiver : ISyntaxReceiver
|
||||||
{
|
{
|
||||||
private readonly List<MethodDeclarationSyntax> _candidateMethods = new();
|
private readonly List<MethodDeclarationSyntax> _candidateMethods = [];
|
||||||
|
|
||||||
public IReadOnlyList<MethodDeclarationSyntax> CandidateMethods
|
public IReadOnlyList<MethodDeclarationSyntax> CandidateMethods
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user