Type properties

ric maicle via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 6 00:03:38 PST 2016


On Wednesday, 06 January, 2016 04:01 PM, ric maicle wrote:
> Why is init allowed to be redefined but not sizeof?
>
> dmd 2.069
>
> import std.stdio;
>
> struct Foo {
>      static int init = 5;
>      static int sizeof = 0;
> }
>
> void main()
> {
>      writeln(Foo.init);
>      writeln(Foo.sizeof);
> }
>
> Error: variable integer.Foo.sizeof .sizeof property cannot be redefined

Found this

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


More information about the Digitalmars-d-learn mailing list