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

a4247cf
Opened by Roy Frostig at 2011-01-27 01:51:35

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.

  1. Fixed ages ago (syntax has changed, but updated it works fine now).

    Graydon Hoare at 2011-01-27 01:51:35