On 1/31/2019 1:46 PM, Andrei Alexandrescu wrote:
The proposal could actually disallow rvalues that have lvalue syntax, such as "symbol", "symbol[expr]", "symbol.symbol", "symbol.symbol[expr]", etc. Ugh. Gets hairy quickly.

That's why it's problematic to have a rule that rvalues can be implicitly converted, but not lvalues. There's not a hard line between lvalues and rvalues. For example,

  foreach(i; 0..2)
  {
    int[] a = [1, 2];
    assert(a[0] == 1]);
    a[0] = 3;  // will this cause the assert to fail?
  }

Reply via email to