Bug 770 – enums and typecasts

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2006-12-29T21:02:00Z
Last change time
2014-02-15T13:20:31Z
Assigned to
bugzilla
Creator
dlang-bugzilla

Comments

Comment #0 by dlang-bugzilla — 2006-12-29T21:02:14Z
The program: import std.socket; static this() { new Socket(AddressFamily.INET, SocketType.STREAM, ProtocolType.TCP); } fails with the error: bug.d(5): constructor std.socket.Socket.this () does not match parameter types (int,SocketType,ProtocolType) However, in the Phobos sources, AdressFamily has the base type "int". An explicit cast resolves the error. Note that AddressFamily's declaration differs by little from SocketType's (just the members), and SocketType works fine without typecasts in the above line (if the first parameter was typecasted). This still worked in DMD v0.167
Comment #1 by dlang-bugzilla — 2006-12-29T21:04:48Z
By "fails" I meant "fails to compile", of course...
Comment #2 by thomas-dloop — 2007-01-01T10:35:15Z
Comment #3 by bugzilla — 2007-01-03T22:54:06Z
Fixed DMD 1.00