Skip to content

A private generic enum used through another module's public type: 'enum_variant_payload_types_frozen generic-inst payload miss' #2188

Closed

Description

@ehartford
// inner.w
enum Pick[T]:
    One(T)
    Two(T)
pub type Holder[T] { pick: Pick[T] }
pub fn Holder.first[T](v: T) -> Holder[T]: Holder { pick: .One(v) }
impl[T] Holder[T]:
    pub fn is_one() -> bool:
        match self.pick:
            .One(_) => true
            .Two(_) => false
// main.w
use inner
let h = Holder.first(3)
print(h.is_one())

Expected: true.
Actual: BUG: enum_variant_payload_types_frozen generic-inst payload miss.

Reflecting an existing instance resolves its template by name, visible from the current module (lookup_named_type_visible(base_sym) in type_reflection_variant_base, enum_variant_payload_types and seven other places). It should use the instance recorded template (generic_inst_template_tid, #1745).

Activity

  1. ehartford commented on Oct 5, 2026

    @ehartford
    ContributorAuthor

    Fixed on main by stack #2196 (merged as efb765c), battery green on a21e326; the regression test for it landed with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions