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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 27 09:01:17 PST 2013


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


andrea.9940 at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrea.9940 at gmail.com
           Platform|x86                         |All
            Version|1.001                       |D2
         OS/Version|Windows                     |All


--- Comment #2 from andrea.9940 at gmail.com 2013-11-27 09:01:12 PST ---
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
    }
}

-- 
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