-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Processing dotnet/runtime#122167 (comment) command:
Command
-amd -arm
using BenchmarkDotNet.Attributes;
[MemoryDiagnoser]
[DisassemblyDiagnoser]
public class Bench
{
private Nullable<bool> _null = null;
private Nullable<bool> _nonnull = true;
[Benchmark] public object BoxNull() => _null;
[Benchmark] public object BoxNonNull() => _nonnull;
// https://github.com/dotnet/runtime/issues/50915
private S? _ns = (S?)default(S);
[Benchmark] public int Issue50915() => CallM(_ns);
static int CallM<T>(T t)
{
if (t is IMyInterface)
return ((IMyInterface)t).M();
return 0;
}
}
interface IMyInterface
{
int M();
}
struct S : IMyInterface
{
public int M() => 42;
}(EgorBot will reply in this issue)
Metadata
Metadata
Assignees
Labels
No labels