mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Remove strictTuple flag and Tuple.length readonly
This commit is contained in:
@@ -67,7 +67,6 @@ namespace ts {
|
||||
const allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === ModuleKind.System;
|
||||
const strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks");
|
||||
const strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes");
|
||||
const strictTuples = getStrictOptionValue(compilerOptions, "strictTuples");
|
||||
const noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny");
|
||||
const noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
|
||||
|
||||
@@ -7303,12 +7302,9 @@ namespace ts {
|
||||
property.type = typeParameter;
|
||||
properties.push(property);
|
||||
}
|
||||
if (strictTuples) {
|
||||
const lengthSymbol = createSymbol(SymbolFlags.Property, "length" as __String);
|
||||
lengthSymbol.type = getLiteralType(arity);
|
||||
lengthSymbol.checkFlags = CheckFlags.Readonly;
|
||||
properties.push(lengthSymbol);
|
||||
}
|
||||
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;
|
||||
|
||||
@@ -276,13 +276,6 @@ namespace ts {
|
||||
category: Diagnostics.Strict_Type_Checking_Options,
|
||||
description: Diagnostics.Enable_strict_checking_of_function_types
|
||||
},
|
||||
{
|
||||
name: "strictTuples",
|
||||
type: "boolean",
|
||||
showInSimplifiedHelpView: true,
|
||||
category: Diagnostics.Strict_Type_Checking_Options,
|
||||
description: Diagnostics.Enable_strict_tuple_checks
|
||||
},
|
||||
{
|
||||
name: "noImplicitThis",
|
||||
type: "boolean",
|
||||
|
||||
@@ -1684,7 +1684,7 @@ namespace ts {
|
||||
return moduleResolution;
|
||||
}
|
||||
|
||||
export type StrictOptionName = "noImplicitAny" | "noImplicitThis" | "strictNullChecks" | "strictFunctionTypes" | "strictTuples" | "alwaysStrict";
|
||||
export type StrictOptionName = "noImplicitAny" | "noImplicitThis" | "strictNullChecks" | "strictFunctionTypes" | "alwaysStrict";
|
||||
|
||||
export function getStrictOptionValue(compilerOptions: CompilerOptions, flag: StrictOptionName): boolean {
|
||||
return compilerOptions[flag] === undefined ? compilerOptions.strict : compilerOptions[flag];
|
||||
|
||||
@@ -3326,10 +3326,6 @@
|
||||
"category": "Message",
|
||||
"code": 6186
|
||||
},
|
||||
"Enable strict tuple checks.": {
|
||||
"category": "Message",
|
||||
"code": 6187
|
||||
},
|
||||
"Variable '{0}' implicitly has an '{1}' type.": {
|
||||
"category": "Error",
|
||||
"code": 7005
|
||||
|
||||
@@ -3785,7 +3785,6 @@ namespace ts {
|
||||
strict?: boolean;
|
||||
strictFunctionTypes?: boolean; // Always combine with strict property
|
||||
strictNullChecks?: boolean; // Always combine with strict property
|
||||
strictTuples?: boolean;
|
||||
/* @internal */ stripInternal?: boolean;
|
||||
suppressExcessPropertyErrors?: boolean;
|
||||
suppressImplicitAnyIndexErrors?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user