Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Remove TypeInfo_Typedef
Browse files Browse the repository at this point in the history
typedef is long gone. However TypeInfo_Enum is inheriting from TypeInfo_Typedef, so we rename the later in the former.
  • Loading branch information
mathias-lang-sociomantic committed Jul 28, 2017
1 parent 0329ee1 commit bec52ee
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/object.d
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,15 @@ class TypeInfo
@property immutable(void)* rtInfo() nothrow pure const @safe @nogc { return null; }
}

class TypeInfo_Typedef : TypeInfo
class TypeInfo_Enum : TypeInfo
{
override string toString() const { return name; }

override bool opEquals(Object o)
{
if (this is o)
return true;
auto c = cast(const TypeInfo_Typedef)o;
auto c = cast(const TypeInfo_Enum)o;
return c && this.name == c.name &&
this.base == c.base;
}
Expand Down Expand Up @@ -361,10 +361,6 @@ unittest // issue 12233
assert(TypeInfo.init is null);
}

class TypeInfo_Enum : TypeInfo_Typedef
{

}

// Please make sure to keep this in sync with TypeInfo_P (src/rt/typeinfo/ti_ptr.d)
class TypeInfo_Pointer : TypeInfo
Expand Down Expand Up @@ -3643,7 +3639,7 @@ private inout(TypeInfo) getElement(inout TypeInfo value) @trusted pure nothrow
{
if(auto qualified = cast(TypeInfo_Const) element)
element = qualified.base;
else if(auto redefined = cast(TypeInfo_Typedef) element) // typedef & enum
else if(auto redefined = cast(TypeInfo_Enum) element)
element = redefined.base;
else if(auto staticArray = cast(TypeInfo_StaticArray) element)
element = staticArray.value;
Expand Down

0 comments on commit bec52ee

Please sign in to comment.