@property not available for classes?
SimonN via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Jan 1 02:22:44 PST 2016
On Friday, 1 January 2016 at 10:14:58 UTC, Shriramana Sharma
wrote:
> auto p = TimeSpan(1, 2);
> Error: no property 'opCall' for type '<src>.TimeSpan'
The error should be in 'auto p = ...', not in the line using the
property.
Instantiate with 'new TimeSpan(1, 2)' instead of 'TimeSpan(1,
2)'. The latter would be the constructor call for a struct.
Classes go on the GC'ed heap by default.
The property syntax should work. :-)
-- Simon
More information about the Digitalmars-d-learn
mailing list