diff --git a/IDEHelper/Tests/src/Constraints.bf b/IDEHelper/Tests/src/Constraints.bf new file mode 100644 index 00000000..d1bd4045 --- /dev/null +++ b/IDEHelper/Tests/src/Constraints.bf @@ -0,0 +1,42 @@ +using System; +using System.Collections; + +namespace Tests +{ + class Constraints + { + class Dicto : Dictionary + { + + } + + public static bool Method1(IEnumerator param1) + { + return true; + } + + public static bool Method2(TEnumerator param1) where TEnumerator : IEnumerator + { + for (let val in param1) + { + + } + + return true; + } + + public static bool Method3(Dictionary param1) where K : IHashable + { + Method1(param1.GetEnumerator()); + Method1((IEnumerator<(K key, V value)>)param1.GetEnumerator()); + return Method2.Enumerator, (K key, V value)>(param1.GetEnumerator()); + } + + [Test] + public static void TestBasics() + { + Dicto dicto = scope .(); + Method3(dicto); + } + } +} diff --git a/IDEHelper/Tests/src/Mixins.bf b/IDEHelper/Tests/src/Mixins.bf index 7bff5aa3..40674527 100644 --- a/IDEHelper/Tests/src/Mixins.bf +++ b/IDEHelper/Tests/src/Mixins.bf @@ -4,6 +4,13 @@ namespace Tests { class Mixins { + static mixin MixNums(int a, int b) + { + (a << 8) | b + } + + const int cVal = MixNums!(3, 5); + class MixClass { public int mA = 100; @@ -39,6 +46,7 @@ namespace Tests mc.MixB!(10); Test.Assert(mc.mA == 120); Test.Assert(MixClass.MixC!(30) == 230); + Test.Assert(cVal == 0x305); } [Test]