Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/.NET-Framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
dotnet-framework:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/dotnet-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/dotnet-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
Expand Down
59 changes: 59 additions & 0 deletions src/DelegateDecompiler.Tests/Issue308.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using System;
using NUnit.Framework;

namespace DelegateDecompiler.Tests;

[TestFixture]
public class Issue308 : DecompilerTestsBase
{
[Test]
public void TestIsValidAt1()
{
static bool Actual<TEntity>(TEntity entity, DateTime dateTime) where TEntity : ITimeValidity =>
entity.IsValidAt(dateTime);

Test(Actual<Entity>, (entity, dateTime) => entity.IsValidAt(dateTime));
}

[Test]
public void TestIsValidAt2()
{
static bool Actual<TEntity>(TEntity entity, IDateTimeProvider dateTimeProvider)
where TEntity : ITimeValidity => entity.IsValidAt(dateTimeProvider.Now);

Test(Actual<Entity>, (entity, dateTimeProvider) => entity.IsValidAt(dateTimeProvider.Now));
}

[Test]
public void TestIsValidAt3()
{
static bool Actual<TEntity>(TEntity entity, DateTime dateTime) where TEntity : ITimeValidity =>
entity.IsValidAt(DateTime.Now);

Test(Actual<Entity>, (entity, dateTime) => entity.IsValidAt(DateTime.Now));
}

[Test]
public void TestIsValidAt4()
{
static bool Actual<TEntity>(TEntity entity) where TEntity : ITimeValidity =>
entity.IsValidAt(DateTime.Now);

Test(Actual<Entity>, entity => entity.IsValidAt(DateTime.Now));
}

interface IDateTimeProvider
{
public DateTime Now { get; }
}

interface ITimeValidity
{
public bool IsValidAt(DateTime time);
}

class Entity : ITimeValidity
{
public bool IsValidAt(DateTime time) => default;
}
}
1 change: 1 addition & 0 deletions src/DelegateDecompiler/Processor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ static int ProcessInstruction(ProcessorState state, Instruction instruction)
if (instruction.OpCode == OpCodes.Nop ||
instruction.OpCode == OpCodes.Break ||
instruction.OpCode == OpCodes.Ret ||
instruction.OpCode == OpCodes.Ldobj ||
instruction.OpCode.OpCodeType == OpCodeType.Prefix ||
instruction.OpCode.FlowControl == FlowControl.Branch)
{
Expand Down