Comments (3)
Modules exports are immutable and all free tables are sealed on that boundary.
from luau.
Modules exports are immutable and all free tables are sealed on that boundary.
Even happens with unsealed tables turning into sealed tables, not only free tables.
Removing the possibility to declare that there's a table which's content is not yet completly fully known.
For a table like
local module = {}
module.Data = {}
return module
if you say Data is unsealed and access to that can be modified, but the type export won't allow it, where I start to not understand if this is intended to be like that or if that can be something that can be changed on Luau.
from luau.
To explain further: both free and unsealed tables are implementation details of the type solver. They are intended to go away when solving is "finished" for a module, which explains the behavior you're seeing here. You should not rely on them being exported through module interfaces, and we have no plans to support that. That you see the free table in Roblox Studio's hover type view is the result of an optimization - we don't sanitize interior types for performance reasons.
Luau generally treats each module as an independent unit, require
calls excepted. This means that Luau isn't going to think about the possibility of module.Data
being changed after the module is required. Supporting this in a way that's up to Luau's standards would require making judgements about the order in which each line of code in the program runs, which is generally impossible.
from luau.
Related Issues (20)
- Add type checking to `Luau.Web.js`
- Incorrect type widening with multiple arguments to generic `T` with new solver HOT 4
- String keys are not checked against table indexer
- Cannot cast into union with literal with new solver's strict mode
- Type refinement rememberance for statically labeled variables assigned to Engine API.
- `luacode.h` uses code not valid in C HOT 2
- Unassigned Generic Types break types unification in new type solver
- "Free Types and {- -}" causes the "autocomplete type and owning area MainModule" to be appended in the old type solver, and don't work in the new type solver HOT 1
- Unable to Table Assign and Locally Assign Variables at the Same Time While Unpacking HOT 2
- Issue with tabs and the Luau Lexer. HOT 2
- adding @inline tag
- [COMPILER OPTIMIZATION] Simplify Conditional Logic Expressions
- "attempt to call a nil value" error message could be improved HOT 1
- Underflow for column count in luau-analyze involving a syntax and return type error in function
- `Luau::findAstAncestryOfPosition` returns short ancestry for global functions with empty blocks
- end keyword doesn't show up in autocomplete suggestions when using a return statement
- Vector XYZW fast path not supported for vectors within immutable globals HOT 1
- Allow removing globals in type definition files
- typeof() not functioning correctly for lightuserdata with a metatable
- Some compiler warnings HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luau.