On 6/12/14, 4:29 PM, Ali Çehreli wrote:
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


void foo() {}
alias bar = foo();

Am I just misunderstanding what is meant by types?

Reply via email to