Skip to content

Commit 2c5d880

Browse files
committed
AST: attempt to rewrite the expression to be more legible
This restores the original spelling of the restriction. This is more legible and may be something which VS2017 will handle properly. Thanks to @drodriguez for suggesting this!
1 parent 675141b commit 2c5d880

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

include/swift/AST/SimpleRequest.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ namespace detail {
113113

114114
/// Extract the first, nearest source location from a tuple.
115115
template<unsigned Index, typename ...Types,
116-
typename = typename std::enable_if<sizeof...(Types) - Index
117-
? true
118-
: false>::type>
116+
typename = typename std::enable_if<(Index < sizeof...(Types))>::type>
119117
SourceLoc extractNearestSourceLocTuple(const std::tuple<Types...> &value) {
120118
SourceLoc loc = maybeExtractNearestSourceLoc(std::get<Index>(value));
121119
if (loc.isValid())

0 commit comments

Comments
 (0)