Skip to content

Segfault when logging string in wildcard branch of pattern alt on type-parameterized multi-variant tag type #137

Closed
@froystig

Description

@froystig

You heard it here first:

// -*- rust -*-

type clam[T] = tag(clammy(T), nun());

fn notmain[T](clam[T] c) {
  alt (c) {
    case (clammy[T](x)) {}
    case (_) {
      /* Remove the log statement below and watch the segfault go away.
       * Alternatively, log an int instead of a string (e.g. |log 2|) */
      log "foo";
    }
  }
}

fn main() {
  let clam[int] c = nun[int]();
  notmain[int](c);
}

Made a number of unsuccessful attempts at simplifying the test-case. Further investigations and test-case reduction clearly needed.

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