[Issue 899] structure field .offsetof property inaccessible in the scope

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 22 08:16:12 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=899


Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #3 from Kenji Hara <k.hara.pg at gmail.com> 2014-01-22 08:16:09 PST ---
(In reply to comment #2)
> Tested on DMD 2.064
> 
> import std.stdio;
> struct Test {
>     int field;
> }
> void main() {
>     writeln(Test.field.offsetof); // works
> }
> class Class {
>     void a() {
>         writeln(Test.field.offsetof);  
>         // Error: this for field needs to be type Test not type main.Class
>     }
> }
> struct Struct {
>     void a() {
>         writeln(Test.field.offsetof);
>         // Error: this for field needs to be type Test not type Struct
>     }
> }

Finally fixed in 2.065a (git-head), by the compiler change:
https://github.com/D-Programming-Language/dmd/pull/2897

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list