Bug 6572 – Deprecate typedef

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-08-29T08:48:00Z
Last change time
2011-11-19T20:21:01Z
Keywords
accepts-invalid, patch
Assigned to
nobody
Creator
yebblies

Comments

Comment #0 by yebblies — 2011-08-29T08:48:24Z
typedef needs to issue a deprecation error when used in D2.
Comment #1 by yebblies — 2011-08-29T09:23:47Z
Comment #2 by hoganmeier — 2011-08-29T09:31:22Z
Shouldn't we provide a complete library based typedef first? http://d.puremagic.com/issues/show_bug.cgi?id=5467
Comment #3 by ibuclaw — 2011-08-29T10:01:12Z
*sadface* I think it is better to catch this in the parser stage, rather than semantic. --- Dsymbols *Parser::parseDeclarations --- if (tok == TOKtypedef) + { + if (!global.params.useDeprecated) + error("typedef is deprecated, use alias"); v = new TypedefDeclaration(loc, ident, t, init); + } Regards Iain
Comment #4 by yebblies — 2011-08-29T19:42:31Z
(In reply to comment #2) > Shouldn't we provide a complete library based typedef first? > http://d.puremagic.com/issues/show_bug.cgi?id=5467 Maybe, probably. (In reply to comment #3) > *sadface* > > I think it is better to catch this in the parser stage, rather than semantic. > > > --- Dsymbols *Parser::parseDeclarations --- > if (tok == TOKtypedef) > + { > + if (!global.params.useDeprecated) > + error("typedef is deprecated, use alias"); > v = new TypedefDeclaration(loc, ident, t, init); > + } > > > Regards > Iain Wouldn't this prevent using typedef even inside version(none) etc blocks? Is that something we want?
Comment #5 by bugzilla — 2011-11-19T20:21:01Z