D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20909 - .offsetof fails on forward reference of field
Summary: .offsetof fails on forward reference of field
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-06-08 18:38 UTC by Boris Carvajal
Modified: 2020-07-09 21:25 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Boris Carvajal 2020-06-08 18:38:31 UTC
Test case:

struct S
{
    pragma(msg, x.sizeof);   // OK
    pragma(msg, x.offsetof); // Error
    int x;
}

Output:

4LU
test.d(4): Error: no property offsetof for type int
test.d(4):        while evaluating pragma(msg, x.offsetof)
Comment 1 Dlang Bot 2020-06-08 19:42:46 UTC
@BorisCarvajal created dlang/dmd pull request #11253 "Fix Issue 20909 - .offsetof fails on forward reference of field" fixing this issue:

- Fix Issue 20909 - .offsetof fails on forward reference of field

https://github.com/dlang/dmd/pull/11253
Comment 2 Dlang Bot 2020-07-02 12:13:06 UTC
dlang/dmd pull request #11253 "Fix Issue 20909 - .offsetof fails on forward reference of field" was merged into stable:

- 5eac9669f827121b494e1ea35afcc8e63c2f76ec by Boris Carvajal:
  Fix Issue 20909 - .offsetof fails on forward reference of field

https://github.com/dlang/dmd/pull/11253
Comment 3 Dlang Bot 2020-07-09 21:25:58 UTC
dlang/dmd pull request #11400 "merge stable" was merged into master:

- bafab33f27941c60a1aeb352084212fa7a0809c0 by Boris Carvajal:
  Fix Issue 20909 - .offsetof fails on forward reference of field

https://github.com/dlang/dmd/pull/11400