mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
undef instead of fakeVal in const variation, fix typeAlias generic
This commit is contained in:
parent
bc39fe6204
commit
f4aa6c26ff
2 changed files with 21 additions and 13 deletions
|
@ -105,6 +105,13 @@ namespace Tests
|
|||
|
||||
}
|
||||
|
||||
typealias BigNum<N> = BigNum<N,const 0>;
|
||||
public struct BigNum<ArgN, ExponentCells> where ArgN : const int where ExponentCells : const int64
|
||||
{
|
||||
static int CalculateN() => Math.Max(1,(int)ArgN);
|
||||
public const int N = CalculateN();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void TestBasics()
|
||||
{
|
||||
|
@ -117,6 +124,8 @@ namespace Tests
|
|||
Test.Assert(iList.SequenceEquals(iSpan));
|
||||
iList.Add(4);
|
||||
Test.Assert(!iList.SequenceEquals(iSpan));
|
||||
|
||||
Test.Assert(BigNum<const 3>.N == 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue