Giter Club home page Giter Club logo

Comments (3)

vegorov-rbx avatar vegorov-rbx commented on July 24, 2024

Modules exports are immutable and all free tables are sealed on that boundary.

from luau.

karl-police avatar karl-police commented on July 24, 2024

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.

AmaranthineCodices avatar AmaranthineCodices commented on July 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.