mirror of
https://github.com/luau-lang/rfcs.git
synced 2025-04-19 03:13:49 +01:00
better example for long running type functions
This commit is contained in:
parent
62cf504ba7
commit
40295408f1
1 changed files with 3 additions and 1 deletions
|
@ -56,7 +56,9 @@ For the first iteration, the body of a type function will be sandboxed, and its
|
||||||
There is also a problem of infinitely running type functions. For example, reducing this type function will halt analysis until the VM stack overflows:
|
There is also a problem of infinitely running type functions. For example, reducing this type function will halt analysis until the VM stack overflows:
|
||||||
```luau
|
```luau
|
||||||
type function neverending(t)
|
type function neverending(t)
|
||||||
return neverending(t) -- note: parentheses are used here because the runtime value of types is being passed in, rather than the static annotation of types
|
while true do
|
||||||
|
local a = 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue