mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-06 16:25:59 +02:00
Fixed typealias dependencies
This commit is contained in:
parent
19c34255df
commit
38dd2cc183
7 changed files with 100 additions and 47 deletions
|
@ -15,7 +15,11 @@ namespace System
|
|||
void Print(String outString);
|
||||
}
|
||||
|
||||
#if BF_LARGE_COLLECTIONS
|
||||
typealias int_cosize = int64;
|
||||
#else
|
||||
typealias int_cosize = int32;
|
||||
#endif
|
||||
|
||||
[AlwaysInclude]
|
||||
static class CompilerSettings
|
||||
|
|
|
@ -1,35 +1,9 @@
|
|||
using System;
|
||||
// Zapples
|
||||
|
||||
struct StructA<T>
|
||||
{
|
||||
public T mVal;
|
||||
|
||||
public static bool operator< <TOther>(StructA<T> lhs, TOther rhs) where bool : operator T < TOther
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/*public static TResult operator+<TOther, TResult>(StructA<T> lhs, TOther rhs)
|
||||
where TResult = operator T * TOther
|
||||
{
|
||||
return lhs.mVal * rhs;
|
||||
}*/
|
||||
}
|
||||
|
||||
class TestA
|
||||
{
|
||||
|
||||
|
||||
public void Bloop()
|
||||
{
|
||||
StructA<float> sa;
|
||||
sa.mVal = 1.23f;
|
||||
let res = sa < 100;
|
||||
|
||||
int a = 1 * 2;
|
||||
}
|
||||
}
|
||||
|
||||
/*class Mintest2
|
||||
{
|
||||
|
@ -59,4 +33,4 @@ class TestA
|
|||
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
|
||||
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1;
|
||||
}
|
||||
}*/
|
||||
}*/
|
||||
|
|
|
@ -1,9 +1,24 @@
|
|||
class Snorf
|
||||
{
|
||||
int mA;
|
||||
using System;
|
||||
|
||||
struct Bloog
|
||||
#define SMz
|
||||
|
||||
#if SM
|
||||
typealias int_test = int32;
|
||||
#else
|
||||
typealias int_test = int64;
|
||||
#endif
|
||||
|
||||
struct Floof
|
||||
{
|
||||
public static int32 Hey()
|
||||
{
|
||||
int mA;
|
||||
Result<int> res = 123;
|
||||
switch (res)
|
||||
{
|
||||
case .Ok(let val):
|
||||
default:
|
||||
}
|
||||
|
||||
return 123;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,22 +143,67 @@ struct Blurg
|
|||
return 0;
|
||||
}
|
||||
|
||||
static mixin ScopedAlloc(int size, int align)
|
||||
{
|
||||
//(void*)scope:mixin [Align(align)] uint8[size]* { ? }
|
||||
}
|
||||
|
||||
public static void TestAlloc()
|
||||
{
|
||||
int i = 1;
|
||||
if (i == 1)
|
||||
{
|
||||
int size = 128;
|
||||
scope:: int[size]*;
|
||||
}
|
||||
}
|
||||
|
||||
struct StructA
|
||||
{
|
||||
public int[10] mA;
|
||||
}
|
||||
|
||||
enum EnumA
|
||||
{
|
||||
case None;
|
||||
case A(StructA sa);
|
||||
}
|
||||
|
||||
enum EnumB
|
||||
{
|
||||
case A;
|
||||
case B(int a, int b);
|
||||
}
|
||||
|
||||
public static int32 Hey()
|
||||
{
|
||||
TypeCode tc = .Boolean;
|
||||
//int h = GetHash(tc);
|
||||
//int_test val = 123;
|
||||
|
||||
var val = tc.Underlying;
|
||||
var valRef = ref tc.UnderlyingRef;
|
||||
(int, int) tup = (1, 3);
|
||||
|
||||
let maxVal = typeof(TypeCode).MaxValue;
|
||||
switch (tup)
|
||||
{
|
||||
case (1, var ref a):
|
||||
a++;
|
||||
PrintF("A\n");
|
||||
default:
|
||||
PrintF("B\n");
|
||||
}
|
||||
|
||||
int a = 100;
|
||||
|
||||
if (tup case (1, var ref aa))
|
||||
{
|
||||
aa += 100;
|
||||
}
|
||||
|
||||
String str = new:gCRTAlloc String(a);
|
||||
/*EnumB eb = .B(1, 2);
|
||||
|
||||
delete:gCRTAlloc str;
|
||||
if (eb case .B(1, var ref bb))
|
||||
{
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
return 123;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue