mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 05:30:13 +03:00
Fix Issue 19706 - Attribute inference in struct fails (#15129)
This commit is contained in:
parent
8c35e9dd02
commit
7dfafe6dd9
2 changed files with 26 additions and 1 deletions
|
@ -1,9 +1,10 @@
|
|||
|
||||
module traits_getFunctionAttributes;
|
||||
|
||||
alias tuple(T...) = T;
|
||||
|
||||
void test_getFunctionAttributes()
|
||||
{
|
||||
alias tuple(T...) = T;
|
||||
|
||||
struct S
|
||||
{
|
||||
|
@ -118,3 +119,14 @@ void test_getFunctionAttributes()
|
|||
static assert(__traits(getFunctionAttributes, systemDel) == tuple!("pure", "nothrow", "@nogc", "@system"));
|
||||
static assert(__traits(getFunctionAttributes, typeof(systemDel)) == tuple!("pure", "nothrow", "@nogc", "@system"));
|
||||
}
|
||||
|
||||
void bug19706()
|
||||
{
|
||||
struct S
|
||||
{
|
||||
static int fImpl(Ret)() { return Ret.init; }
|
||||
|
||||
// tells us: `fImpl!int` is @system
|
||||
static assert(__traits(getFunctionAttributes, fImpl!int) == tuple!("pure", "nothrow", "@nogc", "@safe"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue