mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-10 22:00:54 +01:00
Removed read-only require
This commit is contained in:
parent
43c11ae516
commit
fb62f9b45a
1 changed files with 0 additions and 26 deletions
|
@ -150,32 +150,6 @@ t : { get @metatable : T, p : number }
|
||||||
|
|
||||||
*This is a possibly breaking change.*
|
*This is a possibly breaking change.*
|
||||||
|
|
||||||
### Require
|
|
||||||
|
|
||||||
A `require`d module's properties should be read-only by default.
|
|
||||||
|
|
||||||
If module A is:
|
|
||||||
```lua
|
|
||||||
--!strict
|
|
||||||
local exports = {}
|
|
||||||
exports.p = 0
|
|
||||||
return exports
|
|
||||||
``
|
|
||||||
|
|
||||||
and module B is:
|
|
||||||
```lua
|
|
||||||
--!strict
|
|
||||||
local imports = require(A)
|
|
||||||
```
|
|
||||||
|
|
||||||
then we should have types
|
|
||||||
```
|
|
||||||
exports : { p: number }
|
|
||||||
imports : { get p: number }
|
|
||||||
```
|
|
||||||
|
|
||||||
*This is a possibly breaking change.*
|
|
||||||
|
|
||||||
## Drawbacks
|
## Drawbacks
|
||||||
|
|
||||||
This is adding to the complexity budget for users,
|
This is adding to the complexity budget for users,
|
||||||
|
|
Loading…
Add table
Reference in a new issue