Skip to content

Commit

Permalink
Remove error for old .typeinfo property
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed Aug 28, 2014
1 parent 725c097 commit 301d72f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
17 changes: 1 addition & 16 deletions src/mtype.c
Expand Up @@ -2178,11 +2178,6 @@ Expression *Type::getProperty(Loc loc, Identifier *ident, int flag)
{
e = new IntegerExp(loc, alignsize(), Type::tsize_t);
}
else if (ident == Id::typeinfo)
{
error(loc, ".typeinfo deprecated, use typeid(type)");
e = getTypeInfo(NULL);
}
else if (ident == Id::init)
{
Type *tb = toBasetype();
Expand Down Expand Up @@ -2288,12 +2283,7 @@ Expression *Type::dotExp(Scope *sc, Expression *e, Identifier *ident, int flag)
goto Lreturn;
}
}
if (ident == Id::typeinfo)
{
error(e->loc, ".typeinfo deprecated, use typeid(type)");
e = getTypeInfo(sc);
}
else if (ident == Id::stringof)
if (ident == Id::stringof)
{ /* Bugzilla 3796: this should demangle e->type->deco rather than
* pretty-printing the type.
*/
Expand Down Expand Up @@ -8604,11 +8594,6 @@ Expression *TypeClass::dotExp(Scope *sc, Expression *e, Identifier *ident, int f
return e;
}

if (ident == Id::typeinfo)
{
error(e->loc, ".typeinfo deprecated, use typeid(type)");
return getTypeInfo(sc);
}
if (ident == Id::outer && sym->vthis)
{
if (sym->vthis->scope)
Expand Down
13 changes: 13 additions & 0 deletions test/fail_compilation/faildottypeinfo.d
@@ -0,0 +1,13 @@
/*
TEST_OUTPUT:
---
fail_compilation/faildottypeinfo.d(11): Error: no property 'typeinfo' for type 'int'
fail_compilation/faildottypeinfo.d(12): Error: no property 'typeinfo' for type 'object.Object'
---
*/

void main()
{
auto x = 0.typeinfo;
auto y = Object.typeinfo;
}

0 comments on commit 301d72f

Please sign in to comment.