>>>
void foo(pint p1) {
alias pint=uint;
import std.stdio;
writeln("p1 = ", p1);
}
void main() {
alias pint=uint;
pint var1;
var1 = 7;
foo(var1);
}
<<<
Does not compile.
But the rather similar:
> > >alias pint=uint;
void foo(pint p1) {
import std.stdio;
writeln("p1 = ", p1);
}
void main() {
pint var1;
var1 = 7;
foo(var1);
}
<<<
Is fine.
So 'alias' only valid from definition to end-of-function, rather than whole function?
Best regards