Can't instantiate SimpleTimeZone

Jonathan M Davis jmdavisProg at gmx.com
Thu May 16 10:32:56 PDT 2013


On Thursday, May 16, 2013 16:00:58 Andrej Mitrovic wrote:
> I was using the AE[1] library, but recently it started to fail to
> compile due to essentially this:
> 
> --------
> import std.datetime;
> 
> void main()
> {
> Duration dur;
> auto x = new SimpleTimeZone(dur);
> }
> --------
> 
> > test.d(8): Error: immutable method std.datetime.SimpleTimeZone.this is not
> > callable using a mutable object test.d(8): Error: no constructor for
> > SimpleTimeZone
> 
> The only constructors available for that class are all immutable.
> 
> Why the breaking change? Did it break on purpose? And why is the error
> message so awful?

That code never should have compiled in the first place (though it wouldn't 
hurt my feelings any if it just made it automatically immutable for you given 
than all of the constructors are immutable - maybe that's what was happening 
before). There has to have been a compiler change which changed behavior. All 
TimeZone types have always had to be immutable.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list