#const Self = @This();

1 messages · Page 1 of 1 (latest)

wary stone
#

Hello if been browsing the zig compiler and i noticed a couple of times the usage of const Self = @This(); bit not within a struct but just unscoped im a file. What does this mean?

Eg src/arch/x86-64/CodeGen.zig line 794

brisk mango
#

so @This() works just as youd expect

wary stone
#

I see thanks

remote locust
#

I'm actually really surprised no object oriented language (that I know of) has this feature. It seems perfectly made for them

#

Well, GDScript kind of does it