//META: generated=true
//META: model=claude-opus-4-7
//META: generated_at=2026-05-20T18:00:00+00:00
//META: source_commit=ed8f508fc647eecd788a4bd2bb63a4a6f5c80246
//META: doc_ref=docs/generated/design/name-resolution/visibility.md#container-level-cap
//META: doc_section_digest=eed9de49e1899c3103b9cfa5ed071561030448aa97e7eb41f81be2574b496adc
//META: purpose=A synthesized `$init` for a `public` struct that contains an `internal`-typed field is rejected with `references less visible type`.
//META: intent=negative
//META: pipeline_stage=check
//META: warning=Auto-generated. May drift from source. Do not edit by hand.

// Container-level cap: a public aggregate's synthesized initializer
// is treated as part of the aggregate's signature. With an internal
// field of type `IS`, the synthesized `$init` references a less
// visible type and `checkVisibility` rejects.

//DIAGNOSTIC_TEST:SIMPLE(diag=CHECK):

struct IS {}

public struct PS
//CHECK:      ^^ references less visible type
//CHECK:      ^^ 'PS.init' references less visible type 'IS'.
{
    public IS member;
//CHECK:      ^^^^^^ references less visible type
//CHECK:      ^^^^^^ 'member' references less visible type 'IS'.
}
