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
1 change: 1 addition & 0 deletions src/ddmd/id.d
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ immutable Msgtable[] msgtable =
{ "isTemplate" },
{ "isPOD" },
{ "isDeprecated" },
{ "isFuture" },
{ "isNested" },
{ "isFloating" },
{ "isIntegral" },
Expand Down
5 changes: 5 additions & 0 deletions src/ddmd/traits.d
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ shared static this()
"isArithmetic",
"isAssociativeArray",
"isDeprecated",
"isFuture",
"isFinalClass",
"isPOD",
"isNested",
Expand Down Expand Up @@ -470,6 +471,10 @@ extern (C++) Expression semanticTraits(TraitsExp e, Scope* sc)
{
return isDsymX(t => t.isDeprecated());
}
if (e.ident == Id.isFuture)
{
return isDeclX(t => t.isFuture());
}
if (e.ident == Id.isStaticArray)
{
return isTypeX(t => t.toBasetype().ty == Tsarray);
Expand Down
19 changes: 19 additions & 0 deletions test/runnable/test17878.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@__future int foo()
{
return 0;
}

int bar()
{
return 1;
}

@__future int c;


void main()
{
static assert(__traits(isFuture, foo));
static assert(!__traits(isFuture, bar));
static assert(__traits(isFuture, c));
}