Move comment and refer to tuple type literal syntax rather than TupleType interface

This commit is contained in:
Caitlin Potter
2015-03-10 15:58:39 -04:00
parent 7acb410251
commit 0d06729b18

View File

@@ -4338,9 +4338,11 @@ module ts {
return !!getPropertyOfType(type, "0");
}
/**
* Check if a Type was written as a tuple type literal.
* Prefer using isTupleLikeType() unless the use of `elementTypes` is required.
*/
function isTupleType(type: Type) : boolean {
// Check if a Type exactly implements interface TupleType. Typical typechecking code should rely on
// isTupleLikeType() instead.
return (type.flags & TypeFlags.Tuple) && !!(<TupleType>type).elementTypes;
}