Bug 1595 – (D1 only) Multiple typedefs of Exception should be treated as different types.

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2007-10-19T02:16:09Z
Last change time
2019-07-13T11:42:17Z
Assigned to
No Owner
Creator
Yang Bo

Comments

Comment #0 by pop.atry — 2007-10-19T02:16:09Z
module typedef_exception; typedef Exception MyException1; typedef Exception MyException2; void main() { try { } catch (MyException1 e) { } catch (MyException2 e) { } } typedef_exception.d:5: Error: catch at typedef_exception.d:6 hides catch at typedef_exception.d:7
Comment #1 by dvdfrdmn — 2007-10-19T16:20:58Z
This is a language issue. Changing to enhancement request and reassigning to Walter.
Comment #2 by thomas-dloop — 2007-10-20T02:04:01Z
Comment #3 by dvdfrdmn — 2007-10-20T06:54:47Z
Exception handling is based on class inheritance. Supporting typedefs (using TypeInfo RTTI) is above and beyond what is described in the spec.
Comment #4 by thomas-dloop — 2007-10-20T10:31:48Z
http://www.digitalmars.com/d/declaration.html # Strong types can be introduced with the typedef. Strong # types are semantically a distinct type to the type checking # system, for function overloading, and for the debugger. As far as I understand the quote, typedefs create distinct types. For classes I always asumed that # # typedef Master Slave; # was syntactic sugar for # # class Slave : Master{ # this(...){ # super.this(...); # } # } # however the current implementation only creates a strong-at-compiletime and weak-at-runtime type. Test code: # import std.stdio; # # class Master{ # } # # typedef Master Slave; # # void main(){ # Object o; # # o = new Master(); // 1 # writefln("1: %s", o); # # o = new Slave(); // 2 # writefln("2: %s", o); # } As the debugger currently can't differentiate the types of object 1 and 2 I'd rate this a general bug that was triggered in this case by "catch".
Comment #5 by yao.gomez — 2012-02-04T22:32:00Z
This is a D1 only issue (obviously, as D2 will deprecate typedef). However, the version currently selected is 1.018. What should be done with this reports (besides fixing them) with specific version? Should be changed to the more generic D1?
Comment #6 by yao.gomez — 2012-02-04T22:58:06Z
(In reply to comment #5) > This is a D1 only issue (obviously, as D2 will deprecate typedef). However, the > version currently selected is 1.018. What should be done with this reports > (besides fixing them) with specific version? Should be changed to the more > generic D1? s/this reports/these bug reports
Comment #7 by yebblies — 2012-02-04T23:41:43Z
Yes, the individual versions are not used any more. Having (D1 only) as a prefix in the title also helps differentiate the bugs.
Comment #8 by razvan.nitu1305 — 2019-07-13T11:42:17Z
Closing as WONTFIX as D1 is not supported anymore.