mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed genericParam->genericParam cast check, IgnoreError constraint fail
This commit is contained in:
parent
970ac9add2
commit
1519a60104
4 changed files with 156 additions and 113 deletions
|
@ -241,6 +241,12 @@ namespace Tests
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void MethodG<T, TBase>() where T : TBase
|
||||
{
|
||||
T val = default;
|
||||
TBase valBase = val;
|
||||
}
|
||||
|
||||
public static TResult Sum<T, TElem, TDlg, TResult>(this T it, TDlg dlg)
|
||||
where T: concrete, IEnumerable<TElem>
|
||||
where TDlg: delegate TResult(TElem)
|
||||
|
@ -280,6 +286,16 @@ namespace Tests
|
|||
return .(it.GetEnumerator());
|
||||
}
|
||||
|
||||
class ClassF
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
class ClassG : ClassF
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void TestBasics()
|
||||
{
|
||||
|
@ -339,6 +355,14 @@ namespace Tests
|
|||
Test.Assert(e.GetNext().Value == 2);
|
||||
Test.Assert(e.GetNext().Value == 4);
|
||||
Test.Assert(e.GetNext().Value == 6);
|
||||
|
||||
Test.Assert(
|
||||
[IgnoreErrors(true)]
|
||||
{
|
||||
MethodG<ClassF, ClassG>();
|
||||
true
|
||||
} == false);
|
||||
MethodG<ClassG, ClassF>();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue