[Issue 23620] 'alias this' is not respected in static array length position

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 15 07:02:08 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23620

--- Comment #6 from Salih Dincer <salihdb at hotmail.com> ---
  // because :

  enum index1 = Index();
  assert(
    is(typeof(index1) == struct)
  );

  auto index2 = Index();
  assert(
    !is(typeof(index1) == size_t) &&
    !is(typeof(index2) == size_t)
  );

  // but:

  enum index = Index();
  int[index + 1] d; // automatic conversion
  d[0] = 42; // yeah

SDB at 79

--


More information about the Digitalmars-d-bugs mailing list