From 08558d8cdab7598c4a2e077bd665b49bfee18a79 Mon Sep 17 00:00:00 2001 From: Zuhaitz Méndez Fernández de Aránguiz Date: Sat, 24 Jan 2026 12:29:20 +0000 Subject: Fix for #107 --- tests/features/test_traits_suite.zc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests') diff --git a/tests/features/test_traits_suite.zc b/tests/features/test_traits_suite.zc index 7a2a262..8410de8 100644 --- a/tests/features/test_traits_suite.zc +++ b/tests/features/test_traits_suite.zc @@ -121,3 +121,24 @@ fn print_default_shape(s: Shape = &g_def_circle) { test "implicit_trait_cast_default" { print_default_shape(); } + +trait UnderscoreTest { + fn method_with_underscores_123(self) -> int; +} + +struct UnderscoreStruct { + val: int; +} + +impl UnderscoreTest for UnderscoreStruct { + fn method_with_underscores_123(self) -> int { + return self.val; + } +} + +test "trait_underscores" { + var u = UnderscoreStruct { val: 100 }; + var t: UnderscoreTest = &u; + + assert(t.method_with_underscores_123() == 100, "Method with underscores call failed"); +} -- cgit v1.2.3