Skip to content

Parameterized tags null out the type-parameter-typed value. #133

Closed
@froystig

Description

@froystig

The following test:

// -*- rust -*-                                                         

type noption[T] = tag(some(T));

fn main() {
  let noption[int] nop = some[int](5);
  alt (nop) {
    case (some[int](n)) {
      log n;
      check (n == 5);
    }
  }

  let noption[tup(int, int)] nop2 = some[tup(int, int)](tup(17, 42));
  alt (nop2) {
    case (some[tup(int, int)](t)) {
      log t._0;
      log t._1;
      check (t._0 == 17);
      check (t._1 == 42);
    }
  }
}

Logs '0' at all log points and, for the same reason, fails at all check points.

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