mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-16 15:24:10 +02:00
Added constraints for operators, 'external' constraints for methods
This commit is contained in:
parent
00a92dd0a7
commit
8945a906f7
24 changed files with 1561 additions and 509 deletions
45
IDEHelper/Tests/src/Generics.bf
Normal file
45
IDEHelper/Tests/src/Generics.bf
Normal file
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
|
||||
namespace Tests
|
||||
{
|
||||
class Generics
|
||||
{
|
||||
class ClassA : IDisposable
|
||||
{
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static void DoDispose<T>(mut T val) where T : IDisposable
|
||||
{
|
||||
val.Dispose();
|
||||
}
|
||||
|
||||
struct Disposer<T>
|
||||
{
|
||||
static void UseDispose(IDisposable disp)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void DoDisposeA(mut T val) where T : IDisposable
|
||||
{
|
||||
val.Dispose();
|
||||
UseDispose(val);
|
||||
}
|
||||
|
||||
static void DoDisposeB(mut T val) where T : IDisposable
|
||||
{
|
||||
val.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void TestBasics()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue