Make delete an identifier instead of keyword (#20745)

This commit is contained in:
Dennis 2025-01-21 23:33:50 +01:00 committed by GitHub
parent f60fc38312
commit 096c9c1528
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 246 additions and 417 deletions

View file

@ -383,16 +383,6 @@ void test6714()
assert(bar6714y((a, b){ return a; }) == 2);
}
/***************************************************/
// https://issues.dlang.org/show_bug.cgi?id=7193
void test7193()
{
static assert(!__traits(compiles, {
delete a => a;
}));
}
/***************************************************/
// https://issues.dlang.org/show_bug.cgi?id=7207
// on CastExp
@ -1331,7 +1321,6 @@ int main()
test11();
test3235();
test6714();
test7193();
test7202();
test7288();
test7499();

View file

@ -41,11 +41,30 @@ void test1()
assert(Foo.flags == 1);
}
/*********************************************/
// delete is no longer a keyword and can be used as an identifier
enum E
{
add, delete
}
E delete()
{
return E.delete;
}
void test2()
{
assert(delete() == E.delete);
}
/*********************************************/
int main()
{
test1();
test2();
printf("Success\n");
return 0;