On Sunday, 31 May 2026 at 08:54:39 UTC, Dom Disc wrote:
On Friday, 29 May 2026 at 10:56:51 UTC, Nick Treleaven wrote:
Can you give an example of what you think should work but doesn't?

```d
byte x = 7;
x = -x;  // cannot convert -x of type int to byte
```

At the point of `-x`, the compiler doesn't know that `x != x.min`, so VRP correctly prevents this. Do you think the compiler should allow it? How would it decide that? (If `x` is const, it can be assigned to a byte).
    • Re: Operato... Dom Disc via Digitalmars-d-learn
    • Re: Operato... Nick Treleaven via Digitalmars-d-learn
      • Re: Ope... Meta via Digitalmars-d-learn
        • Re:... Dom Disc via Digitalmars-d-learn
        • Re:... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
        • Re:... Nick Treleaven via Digitalmars-d-learn
          • ... Meta via Digitalmars-d-learn
            • ... Nick Treleaven via Digitalmars-d-learn
            • ... Dom Disc via Digitalmars-d-learn
            • ... Andy Valencia via Digitalmars-d-learn
            • ... Nick Treleaven via Digitalmars-d-learn
            • ... Dom Disc via Digitalmars-d-learn
            • ... Nick Treleaven via Digitalmars-d-learn
  • Re: Operator dec... Dom Disc via Digitalmars-d-learn

Reply via email to