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

Disallow importing private type via use #815

Closed
wants to merge 1 commit into from

Conversation

cburgdorf
Copy link
Collaborator

What was wrong?

We currently do not error when trying to import types via use whith are not pub. E.g. use foo::PrivateStruct does not error.

How was it fixed?

Trivial

To-Do

  • OPTIONAL: Update Spec if applicable

  • Add entry to the release notes (may forgo for trivial changes)

  • Clean up commit history

@cburgdorf cburgdorf force-pushed the christoph/fix/use_pub branch 2 times, most recently from 1828733 to a2c84a3 Compare November 16, 2022 09:34
@cburgdorf cburgdorf requested a review from Y-Nak November 16, 2022 09:34
@cburgdorf cburgdorf marked this pull request as ready for review November 16, 2022 09:34
┌─ compile_errors/bad_visibility/src/main.fe:1:68
1 │ use foo::{MyInt, MY_CONST, MyStruct, MyTrait, my_func, MyContract, MyEnum }
│ ^^^^^^ not found
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not strictly related to the fix but the test was wrong in that it imported a non existing Enum rather than an enum that isn't pub.

Copy link
Member

@Y-Nak Y-Nak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sbillig
Copy link
Collaborator

sbillig commented Nov 23, 2022

Closing; already merged as part of #805

@sbillig sbillig closed this Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants