Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceeded allowed depth big & chain #645

Closed
Boegie19 opened this issue Aug 18, 2022 · 1 comment · Fixed by #1084
Closed

Exceeded allowed depth big & chain #645

Boegie19 opened this issue Aug 18, 2022 · 1 comment · Fixed by #1084
Assignees
Labels
bug Something isn't working

Comments

@Boegie19
Copy link

I have a very & chain of
& (className: "Name") -> ((NameProperties) -> Name)
what Exceeded the allowed depth but if I split it up in 2 and then do
export type ClassNameConstructors = ClassNameConstructors0 & ClassNameConstructors1 it does not exceed the allowed depth and everything is fine.

both scripts are in this zip document
TestCases.zip

So I think luau should be able to handle big chains of &
and also why does the ClassNameConstructors0 & ClassNameConstructors1 work but just adding it in all big & chain not?

@Boegie19 Boegie19 added the bug Something isn't working label Aug 18, 2022
@zeux
Copy link
Collaborator

zeux commented Aug 18, 2022

We have syntactic limits on all constructs - they exist by design. It's the same reason for why you can do this:

local a = 1 + 1 + ... (500 times) + 1
local b = 1 + 1 + ... (500 times) + 1
local c = a + b

but can not do this:

local c = 1 + 1 + ... (1000 times) + 1

Since our parser and many internal algorithms are recursive, this helps make sure that we use a limited amount of stack space in recursive algorithms.

We will double check whether the limits are required in this specific case though.

@zeux zeux self-assigned this Sep 12, 2022
AmaranthineCodices added a commit that referenced this issue Oct 27, 2023
## What's changed

- `bit32.byteswap` added
([RFC](https://github.com/luau-lang/rfcs/blob/4f543ec23b6a1b53396e0803dd253c83041bae62/docs/function-bit32-byteswap.md))
- Buffer library implementation
([RFC](https://github.com/luau-lang/rfcs/blob/4f543ec23b6a1b53396e0803dd253c83041bae62/docs/type-byte-buffer.md))
- Fixed a missing `stdint.h` include
- Fixed parser limiter for recursive type annotations being kind of
weird (fixes #645)

### Native Codegen
- Fixed a pair of issues when lowering `bit32.extract`
- Fixed a narrow edge case that could result in an infinite loop without
an interruption
- Fixed a negative array out-of-bounds access issue
- Temporarily reverted linear block predecessor value propagation

### New type solver
- We now type check assignments to annotated variables
- Fixed some test cases under local type inference
- Moved `isPending` checks for type families to improve performance
- Optimized our process for testing if a free type is sufficiently
solved
- Removed "none ptr" from lea instruction disassembly logging

### Build system & tooling
- CMake configuration now validates dependencies to maintain separation
between components
- Improvements to the fuzzer coverage
- Deduplicator for fuzzed callstacks

---------

Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
Co-authored-by: Vyacheslav Egorov <vegorov@roblox.com>
Co-authored-by: Andy Friesen <afriesen@roblox.com>
Co-authored-by: Aaron Weiss <aaronweiss@roblox.com>
Co-authored-by: Vighnesh Vijay <vvijay@roblox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants