diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-24 12:29:20 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-24 12:29:20 +0000 |
| commit | 08558d8cdab7598c4a2e077bd665b49bfee18a79 (patch) | |
| tree | 941dfa3bfa4b51ca3b0a0dd0ca90f8663832460d /tests/features | |
| parent | 812fe9cbe124bf39a06f58a538c8c01f7402fb09 (diff) | |
Fix for #107
Diffstat (limited to 'tests/features')
| -rw-r--r-- | tests/features/test_traits_suite.zc | 21 |
1 files changed, 21 insertions, 0 deletions
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"); +} |
