mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Remove VarargBaseType from TuplePatternElt and introduce a bit in TuplePattern to indicate if there is a vararg.
The semantics of varargs (only for the last element) make it more appropriate as a property of the TuplePattern. Also free the Parser from needing to construct synthetic types (ArraySlice for type of vararg element) to accommodate the TypeChecker and move the logic to the TypeChecker. This will be more beneficial when the parser stops creating types in general. Swift SVN r6271
This commit is contained in:
@@ -780,8 +780,7 @@ bool FuncDecl::isUnaryOperator() const {
|
||||
if (!argTuple)
|
||||
return true;
|
||||
|
||||
return argTuple->getNumFields() == 1
|
||||
&& !argTuple->getFields()[0].isVararg();
|
||||
return argTuple->getNumFields() == 1 && !argTuple->hasVararg();
|
||||
}
|
||||
|
||||
bool FuncDecl::isBinaryOperator() const {
|
||||
@@ -796,7 +795,7 @@ bool FuncDecl::isBinaryOperator() const {
|
||||
return false;
|
||||
|
||||
return argTuple->getNumFields() == 2
|
||||
|| (argTuple->getNumFields() == 1 && argTuple->getFields()[0].isVararg());
|
||||
|| (argTuple->getNumFields() == 1 && argTuple->hasVararg());
|
||||
}
|
||||
|
||||
StringRef VarDecl::getObjCGetterSelector(llvm::SmallVectorImpl<char> &buffer)
|
||||
|
||||
Reference in New Issue
Block a user