Skip to content

Commit

Permalink
Merge pull request #50 from BlackEdder/imports
Browse files Browse the repository at this point in the history
Support new compiler
  • Loading branch information
BlackEdder committed Jan 21, 2016
2 parents 60b81bc + 0513ab7 commit c9ea3dd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ matrix:
- secure: F1pwSI3BTHI/W0vaUNr2HeS7+25jLJiH2CF9pTW7cySKJGJkyOJ6gJkv71HYxq/cYVda8Y7qy+a//lZFQeWlEmMW4FTblXTE0qVvUzfCw3VRKLGYIMMMi2JzyWJODH+8Q2m19mS9OneZR5zL2NmopJn6wGrfUWZZuerk3XP57C0=
- d: dmd-2.067.1
- d: dmd-2.068.0
- d: dmd
- d: ldc-0.15.1
- d: gdc-4.9.2
2 changes: 1 addition & 1 deletion dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "BSL-1.0",
"dependencies": {
"dunit": "~>1.0.10",
"painlesstraits": "~>0.0.1"
"painlesstraits": "~>0.1.0"
},
"configurations": [
{
Expand Down
13 changes: 6 additions & 7 deletions source/painlessjson/painlessjson.d
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import std.conv;
import std.json;
import std.range;
import std.traits;
import std.typecons : TypeTuple, Tuple;
import std.typecons : Tuple;
import std.typetuple : TypeTuple;
import painlessjson.annotations;
import painlessjson.string;
import painlesstraits;
Expand Down Expand Up @@ -591,15 +592,13 @@ template hasAccessibleConstructor(T)
if (__traits(hasMember, T, "__ctor"))
{
alias Overloads = TypeTuple!(__traits(getOverloads, T, "__ctor"));
bool anyInstanciates = false;
foreach (overload; Overloads)
{
if (__traits(compiles, getInstanceFromCustomConstructor!(T,
overload, false)(JSONValue())))
{
return true;
}
anyInstanciates |= __traits(compiles, getInstanceFromCustomConstructor!(T,
overload, false)(JSONValue()));
}
return false;
return anyInstanciates;
}
}

Expand Down

0 comments on commit c9ea3dd

Please sign in to comment.