July 01, 2004 private in import still not respected - linux 0.94 | ||||
---|---|---|---|---|
| ||||
this still compiles and runs. I would expect to report "undefined identifier std" when compiling B.d however if "private import std.string;" is declared inside the body of class A compilation fails with "B.d(7): undefined identifier std" which is an improvement from previous versions! ######################### A.d private import std.string; private import B; class A { void a() { printf("A test toString for 1 = %.*s\n",std.string.toString(1)); } } void main() { A a = new A; a.a(); B b = new B; b.b(); } ######################### B.d private import A; class B { void b() { printf("B test toString for 1 = %.*s\n",std.string.toString(1)); } } ######################### $ dmd A B -I~/dmd/src/phobos gcc A.o B.o -o A -lphobos -lpthread -lm $ A A test toString for 1 = 1 B test toString for 1 = 1 ######################### Ant |
Copyright © 1999-2021 by the D Language Foundation