[Issue 15674] New: [REG 2.066] alias this rejected for 'out' parameter

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Feb 12 06:05:27 PST 2016


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

          Issue ID: 15674
           Summary: [REG 2.066] alias this rejected for 'out' parameter
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: mathias.lang at sociomantic.com
                CC: public at dicebot.lv

The following code:

```
void get( out int i)
{
    i = 42;
}

struct Foo {
    int v;
    alias v this;
}

void main ()
{
    Foo f;
    get(f);
    assert(f == 42);
}
```

Produce the following error:
reg.d(14): Error: function reg.get (out int i) is not callable using argument
types (Foo)

It used to work in 2.066, broke in 2.067, and is still broken.
It still works with `ref`, though.

--


More information about the Digitalmars-d-bugs mailing list