Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions compiler/test/compilable/fix21945.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// REQUIRED_ARGS: -preview=dip1000

void assertEq(scope int[][3] x) @safe
{
bool b = x == x;
}
15 changes: 15 additions & 0 deletions druntime/src/core/internal/array/equality.d
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ bool __equals(T1, T2)(scope T1[] lhs, scope T2[] rhs) @trusted
return (cast(PureType)&isEqual!(T1,T2))(lhs, rhs, lhs.length);
}

pragma(inline, true)
bool __equals(T1, T2, size_t N)(scope ref T1[N] lhs, scope T2[] rhs) @trusted {
return __equals(lhs[], rhs);
}

pragma(inline, true)
bool __equals(T1, T2, size_t N)(scope T1[] lhs, scope ref T2[N] rhs) @trusted {
return __equals(lhs, rhs[]);
}

pragma(inline, true)
bool __equals(T1, T2, size_t N, size_t M)(scope ref T1[N] lhs, scope ref T2[M] rhs) @trusted {
return __equals(lhs[], rhs[]);
}

/******************************
* Helper function for __equals().
* Outlined to enable __equals() to be inlined, as dmd cannot inline loops.
Expand Down
Loading