[nem-en] Re: Private members & type inference
Andrey Khropov
andrey.khropov at gmail.com
Thu Jan 11 01:12:52 CET 2007
Kamil Skalski wrote:
> > {
> > public SomeField : Some.Long.Qualified.NamespaceName.SomeTypeName = new(1,
> > "...");
> > }
> >
>
> Right, initializer macro could check for some special expressions and
> copy the type as constructor name...
> I'm not sure about new keyword, since we never use it as object
> construction beginning and it would suggest C# developers that new
> should be also used in standard expressions.
Why not just do it the usual way:
{
public SomeField = Some.Long.Qualified.NamespaceName.SomeTypeName(1,
"...");
}
That's the construction (and arbitrary expressions are not allowed), type is
casually inferred as in local functions with def. I think this makes perfect
sense.
--
AKhropov
More information about the devel-en
mailing list