[Issue 830] Access to static member variable causes Access Violation
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jan 11 06:01:20 PST 2007
http://d.puremagic.com/issues/show_bug.cgi?id=830
ralfs72 at gmx.net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
------- Comment #4 from ralfs72 at gmx.net 2007-01-11 08:01 -------
(In reply to comment #3)
> your instance of A is null
>
> This should work:
>
> void main(char[][] args)
> {
> class A
> {
> static int v = 1;
>
> int getv()
> {
> return v;
> }
> }
>
> A a = new A;
> assert (a.getv() == 1);
> }
>
OHH! Sorry! I have to get used to that classes are allways references!
Sorry again! - I put it to INVALID
--
More information about the Digitalmars-d-bugs
mailing list