On Wednesday, 30 January 2019 at 18:29:37 UTC, Manu wrote:
On Wed, Jan 30, 2019 at 9:20 AM Neia Neutuladh via Digitalmars-d-announce <[email protected]> wrote:
The result of a CastExpression is an rvalue. An implicit cast is a compiler-inserted CastExpression. Therefore all lvalues with a potential implicit cast are rvalues.

But there's no existing language rule that attempts to perform an implicit cast where an lvalue is supplied to a ref arg...? Why is the cast being attempted? 'p' is an lvalue, and whatever that does should remain exactly as is (ie, emits a compile error).

We could perhaps allow this for `const` args, but that feels like separate follow-up work to me, and substantially lesser value. This DIP doesn't want to change anything about lvalues.

It appears to say it does:

fun(my_short); // implicit type conversions (ie, short->int promotion)

You should clarify that ;)
              • ... Steven Schveighoffer via Digitalmars-d-announce
              • ... Olivier FAURE via Digitalmars-d-announce
              • ... Steven Schveighoffer via Digitalmars-d-announce
              • ... aliak via Digitalmars-d-announce
              • ... Timon Gehr via Digitalmars-d-announce
              • ... aliak via Digitalmars-d-announce
              • ... 12345swordy via Digitalmars-d-announce
              • ... Aliak via Digitalmars-d-announce
              • ... 12345swordy via Digitalmars-d-announce
              • ... Olivier FAURE via Digitalmars-d-announce
              • ... Nicholas Wilson via Digitalmars-d-announce
              • ... Manu via Digitalmars-d-announce
              • ... Steven Schveighoffer via Digitalmars-d-announce
              • ... Manu via Digitalmars-d-announce
              • ... Andrei Alexandrescu via Digitalmars-d-announce
          • Re: DIP 1... Manu via Digitalmars-d-announce
    • Re: DIP 1016--ref T a... Olivier FAURE via Digitalmars-d-announce
  • Re: DIP 1016--ref T accept... Don via Digitalmars-d-announce

Reply via email to