ditto icon indicating copy to clipboard operation
ditto copied to clipboard

Support `private` modules

Open jmackie opened this issue 3 years ago • 2 comments

A module marked as private can only be imported by other modules in the same package.

private module Implementation.Details exports (..);

The implementation should be fairly straightforward - we just need to check during build planning whether a module imported from a different package is private: true (and raise an error if it is):

Relevant bit of the build planning logic is here:

https://github.com/ditto-lang/ditto/blob/8c3b1c900fb35c49c0f77b99c55cf1bc450763bf/crates/ditto-make/src/build_ninja.rs#L305-L337

The ditto_ast::Module type will also need a private: bool field adding:

https://github.com/ditto-lang/ditto/blob/8c3b1c900fb35c49c0f77b99c55cf1bc450763bf/crates/ditto-ast/src/module.rs#L9

jmackie avatar Apr 11 '22 14:04 jmackie

Hi, Can I take up this issue if possible?

ritikBhandari avatar Apr 11 '22 14:04 ritikBhandari

Hi, Can I take up this issue if possible?

Sure thing 🙏

jmackie avatar Apr 11 '22 14:04 jmackie