Is this a bug? #1363
Is this a bug?
#1363
-
--!strict
local function is_native(): boolean
return debug.info(2, "s") == nil
end
print(`I'm {if is_native() then "compiled" else "interpreted"}`) If I add --!native to this script, it prints: "I'm compiled", otherwise it prints "I'm interpreted" I can't find documentation that says debug.info() doesn't work with --!native |
Beta Was this translation helpful? Give feedback.
Answered by
vegorov-rbx
Aug 12, 2024
Replies: 1 comment
-
Native code generation compiles scripts in with -O2 optimization level, which includes function inlining, the effect of which you see in your script. https://luau-lang.org/performance#function-inlining-and-loop-unrolling |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
maffeus
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Native code generation compiles scripts in with -O2 optimization level, which includes function inlining, the effect of which you see in your script.
https://luau-lang.org/performance#function-inlining-and-loop-unrolling