Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Check that the compiler can generate a runtime function to test AA keys for equality. - This is necessary to switch the druntime implementation from opCmp to opEquals.
- Loading branch information
1 parent
f15bd87
commit bfa8d60
Showing
3 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/fail11591b.d(16): Error: associative array key type S11591 does not have 'const bool opEquals(ref const S11591)' member function | ||
--- | ||
*/ | ||
|
||
struct S11591 | ||
{ | ||
bool opEquals(int i) { return false; } | ||
Object o; // needed to suppress compiler generated opEquals | ||
} | ||
|
||
void test11591() | ||
{ | ||
int[S11591] aa; | ||
} | ||
|
||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/fail11591b.d(30): Error: associative array key type S12307a does not have 'const bool opEquals(ref const S12307a)' member function | ||
fail_compilation/fail11591b.d(31): Error: associative array key type S12307b does not have 'const bool opEquals(ref const S12307b)' member function | ||
--- | ||
*/ | ||
struct S12307a { bool opEquals(T : typeof(this))(T) { return false; } } | ||
|
||
void test12307() | ||
{ | ||
int[S12307a] aa1; // a | ||
int[S12307b] aa2; // b | ||
} | ||
|
||
struct S12307b { bool opEquals(T : typeof(this))(T) { return false; } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters