www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Can't print inout parameter

The example below fails to compile:

inout(int) foo (inout int a)
{
     writeln(a);
     return a;
}

void main ()
{
     foo(1);
}

If I remove the call to "writeln" it compiles.

DMD 2.060 on Mac OS X, error message:

conv.d(3572): Error: template instance Unqual!(__T4ImplTNgiZ) 
Unqual!(__T4ImplTNgiZ) does not match template declaration Unqual(T)
conv.d(3572): Error: Unqual!(__T4ImplTNgiZ) is used as a type
stdio.d(692): Error: template instance 
std.conv.toTextRange!(inout(int),LockingTextWriter) error instantiating
stdio.d(1595):        instantiated from here: write!(inout(int),char)
main.d(10):        instantiated from here: writeln!(inout(int))
stdio.d(1595): Error: template instance 
std.stdio.File.write!(inout(int),char) error instantiating
main.d(10):        instantiated from here: writeln!(inout(int))
main.d(10): Error: template instance std.stdio.writeln!(inout(int)) 
error instantiating
Failed: /Users/jacob/.dvm/bin/dvm-current-dc  -v -o- 
'/Users/jacob/development/d/main.d' -I'/Users/jacob/development/d' 
/Users/jacob/development/d/main.d.deps

-- /Jacob Carlborg
Oct 04 2012