Bug 4102 – 'object' name in module declaration

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-04-17T17:31:00Z
Last change time
2015-06-09T05:15:19Z
Keywords
rejects-valid
Assigned to
nobody
Creator
repeatedly

Comments

Comment #0 by repeatedly — 2010-04-17T17:31:36Z
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
The provided code works as of 2.065.