Cannot alias null

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 12 13:29:24 PDT 2014


On 06/12/2014 01:26 PM, Tom Browder via Digitalmars-d-learn wrote:

 > This will not compile:
 >
 >    alias blah = null;
 >
 > The dmd message are:
 >
 > di/test_hdr.d(10): Error: basic type expected, not null
 > di/test_hdr.d(10): Error: semicolon expected to close alias declaration
 > di/test_hdr.d(10): Error: Declaration expected, not 'null'
 >
 > Are there any other objects that cannot be aliased?

alias works only with types. Being an expression (not an object), null 
cannot not work with alias.

Ali



More information about the Digitalmars-d-learn mailing list