www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15674] New: [REG 2.066] alias this rejected for 'out' parameter


          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 puremagic.com
          Reporter: mathias.lang sociomantic.com
                CC: public dicebot.lv

The following code:

void get( out int i)
    i = 42;

struct Foo {
    int v;
    alias v this;

void main ()
    Foo 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.

Feb 12 2016