From 6e471c3d56682fb71b506066dd2f67ee31598673 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Tue, 27 Jun 2023 11:49:14 -0500 Subject: [PATCH] added: test case for structure method tags --- tests/structure_method_tag | 2 ++ tests/structure_method_tag.onyx | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/structure_method_tag create mode 100644 tests/structure_method_tag.onyx diff --git a/tests/structure_method_tag b/tests/structure_method_tag new file mode 100644 index 00000000..5661a260 --- /dev/null +++ b/tests/structure_method_tag @@ -0,0 +1,2 @@ +Some tag +Called the method! diff --git a/tests/structure_method_tag.onyx b/tests/structure_method_tag.onyx new file mode 100644 index 00000000..e6ce6078 --- /dev/null +++ b/tests/structure_method_tag.onyx @@ -0,0 +1,18 @@ +use core {*} +use runtime + +Some_Structure :: struct { + @"Some tag" + some_method :: () { + println("Called the method!"); + } +} + +main :: () { + the_type := Some_Structure; + the_method := *cast(&()->void, the_type->info()->as_struct().methods[0].func.data); + the_tag := misc.any_as(runtime.info.get_tags_for_procedure(the_method)[0], str); + println(*the_tag); + + the_method(); +} -- 2.25.1