Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler should error if a source file from a different library is imported #7147

Open
Chriscbr opened this issue Sep 19, 2024 · 0 comments
Open
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler

Comments

@Chriscbr
Copy link
Contributor

I tried this:

If you have two different Wing packages:

foo/
|- wing.toml
|- main.w
bar/
|- wing.toml
|- other.w

Directly importing files between them should be compile time error:

// file: foo/main.w
bring "../bar/other.w" as other; // error: cannot directly import files from another Wing package

It feels like it may be a safer boundary if we require that a library must take an explicit dependency on another in order to be used, and imports must be made through the library name.

This happened:

No error is raised today

I expected this:

No response

Is there a workaround?

No response

Anything else?

No response

Wing Version

0.85.9

Node.js Version

No response

Platform(s)

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
@Chriscbr Chriscbr added 🐛 bug Something isn't working 🛠️ compiler Compiler labels Sep 19, 2024
@monadabot monadabot added this to Wing Sep 19, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New - not properly defined in Wing Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler
Projects
Status: 🆕 New - not properly defined
Development

No branches or pull requests

1 participant