From f519a6791d550b1f95485c7f5f3c1f1f3186db12 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Thu, 30 Jun 2022 01:08:31 +0200 Subject: [PATCH] :white_check_mark: Add test --- tests/fptr/fptr_cast.gw | 3 +++ tests/tree/inherit_func.gw | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/fptr/fptr_cast.gw create mode 100644 tests/tree/inherit_func.gw diff --git a/tests/fptr/fptr_cast.gw b/tests/fptr/fptr_cast.gw new file mode 100644 index 00000000..a79971cf --- /dev/null +++ b/tests/fptr/fptr_cast.gw @@ -0,0 +1,3 @@ +\ a { return 2; }(2); +(\ a { return 2; } $ (int(int))); +#!\ a { return 2; }(3); diff --git a/tests/tree/inherit_func.gw b/tests/tree/inherit_func.gw new file mode 100644 index 00000000..02e75366 --- /dev/null +++ b/tests/tree/inherit_func.gw @@ -0,0 +1,14 @@ +#! [contains] baz + +#! check that functions are called from the vtable + +class C { + fun void foo() { <<< "bar" >>>; } +} + +class D extends C{ + fun void foo() { <<< "baz" >>>; } +} + +var D d; +d.foo(); -- 2.43.0