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

@private not enforced in some cases #1407

Open
milesziemer opened this issue Sep 15, 2022 · 0 comments
Open

@private not enforced in some cases #1407

milesziemer opened this issue Sep 15, 2022 · 0 comments
Labels
bug This issue is a bug. guidance Question that needs advice or information.

Comments

@milesziemer
Copy link
Contributor

This issue arose from investigation into #1369.

This example shows cases where @private is not enforced:

$version: "2"

namespace example.private

@private
resource PrivateResource {
    identifiers: {
        id: String
    }
}

@mixin
structure MixinWithPrivateMember {
    @private
    member: String
}
$version: "2"

namespace example.public

use example.private#PrivateResource
use example.private#MixinWithPrivateMember

// 1. Target elision with private resource
structure PrivateResourceUsage for PrivateResource {
    $id
}

// 2. Target elision of private member of mixin
structure PrivateMemberOfMixinUsage with [MixinWithPrivateMember] {
    @required
    $member
}

From what I can tell, the resource-structure binding syntax (for) is not modeled by the JSON AST, which is what the validation tests use, so there may not be an obvious way to enforce @private for 1. For 2., it's not clear to me whether this case should be allowed or not. The private member member is being referenced in a different namespace, but maybe this is expected behavior for mixins.

@milesziemer milesziemer added bug This issue is a bug. guidance Question that needs advice or information. labels Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

1 participant