www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15965] New: [REG 2.070] Reference to other CT-known field on

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

          Issue ID: 15965
           Summary: [REG 2.070] Reference to other CT-known field on
                    struct instantiation now yields "circular reference"
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: mathias.lang sociomantic.com
                CC: public dicebot.lv

Here's an extract of a piece of code we had:

```
struct Element
{
    public ubyte[256] val;
    private ubyte[(val.offsetof + 256) % size_t.sizeof] _padding;
}
```

This used to compile up until 2.071.0, where it broke.

Is it an intentional change, and is it expected that accessing `offsetof`
during struct instantiation now fails ?

--
Apr 28 2016