www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - meaning import order?

reply Alexey Veselovsky <alexey.veselovsky gmail.com> writes:
=====================
$ cat main.d
import std = std.stdio;
import std.socket;
import std.array;
import std.getopt;

void main() { std.writeln("bar");}
======================

compiles ok. But:

import std.socket;
import std.array;
import std.getopt;
import std = std.stdio;

void main() { std.writeln("bar");}

$ dmd main.d
main.d(6): Error: undefined identifier package std.writeln

wtf?
Nov 13 2011
parent "Nick Sabalausky" <a a.a> writes:
"Alexey Veselovsky" <alexey.veselovsky gmail.com> wrote in message 
news:mailman.928.1321256527.24802.digitalmars-d puremagic.com...
 =====================
 $ cat main.d
 import std = std.stdio;
 import std.socket;
 import std.array;
 import std.getopt;

 void main() { std.writeln("bar");}
 ======================

 compiles ok. But:

 import std.socket;
 import std.array;
 import std.getopt;
 import std = std.stdio;

 void main() { std.writeln("bar");}

 $ dmd main.d
 main.d(6): Error: undefined identifier package std.writeln

 wtf?
Looks like a bug, you should file it at http://d.puremagic.com/issues/ It might have something to do with an existing bug with renamed imports.
Nov 14 2011