mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Better handling of extern generic constraints
This commit is contained in:
parent
4fa46b6a92
commit
1e44392da8
4 changed files with 75 additions and 5 deletions
|
@ -1,3 +1,5 @@
|
|||
#pragma warning disable 168
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
|
@ -21,6 +23,32 @@ namespace Tests
|
|||
}
|
||||
}
|
||||
|
||||
interface IZop
|
||||
{
|
||||
void Zop();
|
||||
}
|
||||
|
||||
interface IZag
|
||||
{
|
||||
void Zag();
|
||||
}
|
||||
|
||||
class ClassC<T> where T : IDisposable
|
||||
{
|
||||
public void MethodA(T val) where T : IZop, delete, new
|
||||
{
|
||||
val.Zop();
|
||||
MethodB(val);
|
||||
delete val;
|
||||
}
|
||||
|
||||
public void MethodB(T val) where T : IZop, delete, new
|
||||
{
|
||||
alloctype(T) z = new T();
|
||||
delete val;
|
||||
}
|
||||
}
|
||||
|
||||
struct TestFunc<T, Del>
|
||||
{
|
||||
private int mId;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue