typedef needs to issue a deprecation error when used in D2.
https://github.com/D-Programming-Language/dmd/pull/354 https://github.com/D-Programming-Language/druntime/pull/63 https://github.com/D-Programming-Language/phobos/pull/224
Shouldn't we provide a complete library based typedef first? http://d.puremagic.com/issues/show_bug.cgi?id=5467
*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
(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?
https://github.com/D-Programming-Language/dmd/commit/a22fd423f3896dd17d59e39cdb809ba7721faad2