mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
Make delete
an identifier instead of keyword (#20745)
This commit is contained in:
parent
f60fc38312
commit
096c9c1528
17 changed files with 246 additions and 417 deletions
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue