What does the "@" symbol do in scripting?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I would like to know what the @ symbol does in a script

  2. What is the issue? Include screenshots / videos if possible!
    I do not know what the @ symbol does in a script

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried searching it up, but have found no results

2 Likes

Could you provide an example for when it’s in use, I’ve never seen it in code before, unless it’s in a comment for documentation (i.e @param, @return)

1 Like

i believe it is for typechecking.
The only instance i know of using this is @native,

2 Likes

I just have no idea what this is used for at all and need some help knowing what it is cuz im curious

It’s a new Luau feature called function attributes. Quoting the RFC:

Add a syntax for attributes to function declarations in the style of @name that can be placed before their declarations to adjust the behavior of the compiler, analyzer, and runtime.

Basically, if I understand correctly, putting an attribute before a function can adjust the behaviour of Luau and how it handles the function.

As far as I know, the only function attribute that exists right now is @native, which tells the compiler to compile the function to native code using native code generation

5 Likes

Thanks! That’s exactly the type of response i was looking for, and i perfectly understand now!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.