Skip to content

Commit

Permalink
opover.d: Refactor pattern matching with isXXX (#20794)
Browse files Browse the repository at this point in the history
Co-authored-by: Dennis Korpel <[email protected]>
  • Loading branch information
dkorpel and Dennis Korpel authored Jan 28, 2025
1 parent a55dff5 commit c3da7f0
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 63 deletions.
8 changes: 4 additions & 4 deletions compiler/src/dmd/mtype.d
Original file line number Diff line number Diff line change
Expand Up @@ -4316,10 +4316,10 @@ void attributesApply(const TypeFunction tf, void delegate(string) dg, TRUSTforma
AggregateDeclaration isAggregate(Type t)
{
t = t.toBasetype();
if (t.ty == Tclass)
return (cast(TypeClass)t).sym;
if (t.ty == Tstruct)
return (cast(TypeStruct)t).sym;
if (auto tc = t.isTypeClass())
return tc.sym;
if (auto ts = t.isTypeStruct())
return ts.sym;
return null;
}

Expand Down
Loading

0 comments on commit c3da7f0

Please sign in to comment.