mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-01 22:05:59 +02:00
Initial checkin
This commit is contained in:
parent
c74712dad9
commit
078564ac9e
3242 changed files with 1616395 additions and 0 deletions
60
IDE/Tests/Test1/src/Inline.bf
Normal file
60
IDE/Tests/Test1/src/Inline.bf
Normal file
|
@ -0,0 +1,60 @@
|
|||
#pragma warning disable 168
|
||||
|
||||
using System;
|
||||
|
||||
namespace IDETest
|
||||
{
|
||||
class InlineTester
|
||||
{
|
||||
[Inline]
|
||||
public static int TimesTwo(int a)
|
||||
{
|
||||
return a * 2;
|
||||
}
|
||||
|
||||
[Inline]
|
||||
public static int Add(int a, int b)
|
||||
{
|
||||
int retVal = TimesTwo(a);
|
||||
retVal += TimesTwo(b);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public static int PlusOne(int a)
|
||||
{
|
||||
return a + 1;
|
||||
}
|
||||
|
||||
public static mixin MixB(var argC)
|
||||
{
|
||||
argC = PlusOne(argC);
|
||||
argC
|
||||
}
|
||||
|
||||
public static mixin MixA(var argA, var argB)
|
||||
{
|
||||
int z = MixB!(argA);
|
||||
argA + argB
|
||||
}
|
||||
|
||||
public static void TestInlines()
|
||||
{
|
||||
int a = 123;
|
||||
int b = 234;
|
||||
int d = Add(a, b);
|
||||
}
|
||||
|
||||
public static void Test()
|
||||
{
|
||||
int a = 10;
|
||||
int b = 2;
|
||||
|
||||
//InlineTester
|
||||
int c = MixA!(a, b);
|
||||
|
||||
TestInlines();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue