Merge pull request #17765 from tycho01/6229-known-length-tuples

add `strictTuples` flag giving tuples known length
This commit is contained in:
Nathan Shively-Sanders
2017-11-08 15:38:39 -08:00
committed by GitHub
53 changed files with 847 additions and 298 deletions

View File

@@ -7310,6 +7310,9 @@ namespace ts {
property.type = typeParameter;
properties.push(property);
}
const lengthSymbol = createSymbol(SymbolFlags.Property, "length" as __String);
lengthSymbol.type = getLiteralType(arity);
properties.push(lengthSymbol);
const type = <GenericType & InterfaceTypeWithDeclaredMembers>createObjectType(ObjectFlags.Tuple | ObjectFlags.Reference);
type.typeParameters = typeParameters;
type.outerTypeParameters = undefined;