Now, I am writing serialization library for Phobos(repository is located bitbucket http://bitbucket.org/repeatedly/msgpack4d ). I create msgpack.object module but compilation error occurs. The module that contains 'object' can't use some classes defined in default object module. Following code is example:
-----
module foo.object;
class FooException : Exception { this(string msg) { super(msg); } }
-----
% dmd main.d foo/object.d
foo/object.d(3): Error: identifier 'Exception' is not defined
foo/object.d(3): Error: Exception is used as a type
foo/object.d(3): Error: class foo.object.FooException base type must be class or interface, not void
foo/object.d(3): Error: identifier 'Object' is not defined
foo/object.d(3): Error: Object is used as a type
Assertion failed: (b->type->ty == Tclass), function semantic, file class.c, line 454.
foo.object hides default object module. Is this a bug or doesn't module declaration contain 'object'?
To avoid this problem uses 'import object;' in foo.objcet.
Comment #1 by lt.infiltrator — 2014-03-18T22:44:53Z