Accept new baselines

This commit is contained in:
Anders Hejlsberg
2018-06-09 12:19:46 -07:00
parent 2e04322a6d
commit 346276ce7a
15 changed files with 328 additions and 346 deletions
@@ -1,7 +0,0 @@
tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType3.ts(1,8): error TS1122: A tuple type element list cannot be empty.
==== tests/cases/conformance/parser/ecmascript5/TupleTypes/TupleType3.ts (1 errors) ====
var v: []
~~
!!! error TS1122: A tuple type element list cannot be empty.
@@ -1,11 +1,8 @@
tests/cases/compiler/anyIndexedAccessArrayNoException.ts(1,12): error TS1122: A tuple type element list cannot be empty.
tests/cases/compiler/anyIndexedAccessArrayNoException.ts(1,12): error TS2538: Type '[]' cannot be used as an index type.
==== tests/cases/compiler/anyIndexedAccessArrayNoException.ts (2 errors) ====
==== tests/cases/compiler/anyIndexedAccessArrayNoException.ts (1 errors) ====
var x: any[[]];
~~
!!! error TS1122: A tuple type element list cannot be empty.
~~
!!! error TS2538: Type '[]' cannot be used as an index type.
+153 -143
View File
@@ -231,143 +231,144 @@ declare namespace ts {
TypeLiteral = 166,
ArrayType = 167,
TupleType = 168,
UnionType = 169,
IntersectionType = 170,
ConditionalType = 171,
InferType = 172,
ParenthesizedType = 173,
ThisType = 174,
TypeOperator = 175,
IndexedAccessType = 176,
MappedType = 177,
LiteralType = 178,
ImportType = 179,
ObjectBindingPattern = 180,
ArrayBindingPattern = 181,
BindingElement = 182,
ArrayLiteralExpression = 183,
ObjectLiteralExpression = 184,
PropertyAccessExpression = 185,
ElementAccessExpression = 186,
CallExpression = 187,
NewExpression = 188,
TaggedTemplateExpression = 189,
TypeAssertionExpression = 190,
ParenthesizedExpression = 191,
FunctionExpression = 192,
ArrowFunction = 193,
DeleteExpression = 194,
TypeOfExpression = 195,
VoidExpression = 196,
AwaitExpression = 197,
PrefixUnaryExpression = 198,
PostfixUnaryExpression = 199,
BinaryExpression = 200,
ConditionalExpression = 201,
TemplateExpression = 202,
YieldExpression = 203,
SpreadElement = 204,
ClassExpression = 205,
OmittedExpression = 206,
ExpressionWithTypeArguments = 207,
AsExpression = 208,
NonNullExpression = 209,
MetaProperty = 210,
TemplateSpan = 211,
SemicolonClassElement = 212,
Block = 213,
VariableStatement = 214,
EmptyStatement = 215,
ExpressionStatement = 216,
IfStatement = 217,
DoStatement = 218,
WhileStatement = 219,
ForStatement = 220,
ForInStatement = 221,
ForOfStatement = 222,
ContinueStatement = 223,
BreakStatement = 224,
ReturnStatement = 225,
WithStatement = 226,
SwitchStatement = 227,
LabeledStatement = 228,
ThrowStatement = 229,
TryStatement = 230,
DebuggerStatement = 231,
VariableDeclaration = 232,
VariableDeclarationList = 233,
FunctionDeclaration = 234,
ClassDeclaration = 235,
InterfaceDeclaration = 236,
TypeAliasDeclaration = 237,
EnumDeclaration = 238,
ModuleDeclaration = 239,
ModuleBlock = 240,
CaseBlock = 241,
NamespaceExportDeclaration = 242,
ImportEqualsDeclaration = 243,
ImportDeclaration = 244,
ImportClause = 245,
NamespaceImport = 246,
NamedImports = 247,
ImportSpecifier = 248,
ExportAssignment = 249,
ExportDeclaration = 250,
NamedExports = 251,
ExportSpecifier = 252,
MissingDeclaration = 253,
ExternalModuleReference = 254,
JsxElement = 255,
JsxSelfClosingElement = 256,
JsxOpeningElement = 257,
JsxClosingElement = 258,
JsxFragment = 259,
JsxOpeningFragment = 260,
JsxClosingFragment = 261,
JsxAttribute = 262,
JsxAttributes = 263,
JsxSpreadAttribute = 264,
JsxExpression = 265,
CaseClause = 266,
DefaultClause = 267,
HeritageClause = 268,
CatchClause = 269,
PropertyAssignment = 270,
ShorthandPropertyAssignment = 271,
SpreadAssignment = 272,
EnumMember = 273,
SourceFile = 274,
Bundle = 275,
UnparsedSource = 276,
InputFiles = 277,
JSDocTypeExpression = 278,
JSDocAllType = 279,
JSDocUnknownType = 280,
JSDocNullableType = 281,
JSDocNonNullableType = 282,
JSDocOptionalType = 283,
JSDocFunctionType = 284,
JSDocVariadicType = 285,
JSDocComment = 286,
JSDocTypeLiteral = 287,
JSDocSignature = 288,
JSDocTag = 289,
JSDocAugmentsTag = 290,
JSDocClassTag = 291,
JSDocCallbackTag = 292,
JSDocParameterTag = 293,
JSDocReturnTag = 294,
JSDocTypeTag = 295,
JSDocTemplateTag = 296,
JSDocTypedefTag = 297,
JSDocPropertyTag = 298,
SyntaxList = 299,
NotEmittedStatement = 300,
PartiallyEmittedExpression = 301,
CommaListExpression = 302,
MergeDeclarationMarker = 303,
EndOfDeclarationMarker = 304,
Count = 305,
OptionalType = 169,
UnionType = 170,
IntersectionType = 171,
ConditionalType = 172,
InferType = 173,
ParenthesizedType = 174,
ThisType = 175,
TypeOperator = 176,
IndexedAccessType = 177,
MappedType = 178,
LiteralType = 179,
ImportType = 180,
ObjectBindingPattern = 181,
ArrayBindingPattern = 182,
BindingElement = 183,
ArrayLiteralExpression = 184,
ObjectLiteralExpression = 185,
PropertyAccessExpression = 186,
ElementAccessExpression = 187,
CallExpression = 188,
NewExpression = 189,
TaggedTemplateExpression = 190,
TypeAssertionExpression = 191,
ParenthesizedExpression = 192,
FunctionExpression = 193,
ArrowFunction = 194,
DeleteExpression = 195,
TypeOfExpression = 196,
VoidExpression = 197,
AwaitExpression = 198,
PrefixUnaryExpression = 199,
PostfixUnaryExpression = 200,
BinaryExpression = 201,
ConditionalExpression = 202,
TemplateExpression = 203,
YieldExpression = 204,
SpreadElement = 205,
ClassExpression = 206,
OmittedExpression = 207,
ExpressionWithTypeArguments = 208,
AsExpression = 209,
NonNullExpression = 210,
MetaProperty = 211,
TemplateSpan = 212,
SemicolonClassElement = 213,
Block = 214,
VariableStatement = 215,
EmptyStatement = 216,
ExpressionStatement = 217,
IfStatement = 218,
DoStatement = 219,
WhileStatement = 220,
ForStatement = 221,
ForInStatement = 222,
ForOfStatement = 223,
ContinueStatement = 224,
BreakStatement = 225,
ReturnStatement = 226,
WithStatement = 227,
SwitchStatement = 228,
LabeledStatement = 229,
ThrowStatement = 230,
TryStatement = 231,
DebuggerStatement = 232,
VariableDeclaration = 233,
VariableDeclarationList = 234,
FunctionDeclaration = 235,
ClassDeclaration = 236,
InterfaceDeclaration = 237,
TypeAliasDeclaration = 238,
EnumDeclaration = 239,
ModuleDeclaration = 240,
ModuleBlock = 241,
CaseBlock = 242,
NamespaceExportDeclaration = 243,
ImportEqualsDeclaration = 244,
ImportDeclaration = 245,
ImportClause = 246,
NamespaceImport = 247,
NamedImports = 248,
ImportSpecifier = 249,
ExportAssignment = 250,
ExportDeclaration = 251,
NamedExports = 252,
ExportSpecifier = 253,
MissingDeclaration = 254,
ExternalModuleReference = 255,
JsxElement = 256,
JsxSelfClosingElement = 257,
JsxOpeningElement = 258,
JsxClosingElement = 259,
JsxFragment = 260,
JsxOpeningFragment = 261,
JsxClosingFragment = 262,
JsxAttribute = 263,
JsxAttributes = 264,
JsxSpreadAttribute = 265,
JsxExpression = 266,
CaseClause = 267,
DefaultClause = 268,
HeritageClause = 269,
CatchClause = 270,
PropertyAssignment = 271,
ShorthandPropertyAssignment = 272,
SpreadAssignment = 273,
EnumMember = 274,
SourceFile = 275,
Bundle = 276,
UnparsedSource = 277,
InputFiles = 278,
JSDocTypeExpression = 279,
JSDocAllType = 280,
JSDocUnknownType = 281,
JSDocNullableType = 282,
JSDocNonNullableType = 283,
JSDocOptionalType = 284,
JSDocFunctionType = 285,
JSDocVariadicType = 286,
JSDocComment = 287,
JSDocTypeLiteral = 288,
JSDocSignature = 289,
JSDocTag = 290,
JSDocAugmentsTag = 291,
JSDocClassTag = 292,
JSDocCallbackTag = 293,
JSDocParameterTag = 294,
JSDocReturnTag = 295,
JSDocTypeTag = 296,
JSDocTemplateTag = 297,
JSDocTypedefTag = 298,
JSDocPropertyTag = 299,
SyntaxList = 300,
NotEmittedStatement = 301,
PartiallyEmittedExpression = 302,
CommaListExpression = 303,
MergeDeclarationMarker = 304,
EndOfDeclarationMarker = 305,
Count = 306,
FirstAssignment = 58,
LastAssignment = 70,
FirstCompoundAssignment = 59,
@@ -379,7 +380,7 @@ declare namespace ts {
FirstFutureReservedWord = 108,
LastFutureReservedWord = 116,
FirstTypeNode = 161,
LastTypeNode = 179,
LastTypeNode = 180,
FirstPunctuation = 17,
LastPunctuation = 70,
FirstToken = 0,
@@ -393,10 +394,10 @@ declare namespace ts {
FirstBinaryOperator = 27,
LastBinaryOperator = 70,
FirstNode = 146,
FirstJSDocNode = 278,
LastJSDocNode = 298,
FirstJSDocTagNode = 289,
LastJSDocTagNode = 298
FirstJSDocNode = 279,
LastJSDocNode = 299,
FirstJSDocTagNode = 290,
LastJSDocTagNode = 299
}
enum NodeFlags {
None = 0,
@@ -751,6 +752,10 @@ declare namespace ts {
kind: SyntaxKind.TupleType;
elementTypes: NodeArray<TypeNode>;
}
interface OptionalTypeNode extends TypeNode {
kind: SyntaxKind.OptionalType;
type: TypeNode;
}
type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode;
interface UnionTypeNode extends TypeNode {
kind: SyntaxKind.UnionType;
@@ -2249,6 +2254,9 @@ declare namespace ts {
}
interface GenericType extends InterfaceType, TypeReference {
}
interface TupleType extends GenericType {
minLength: number;
}
interface UnionOrIntersectionType extends Type {
types: Type[];
}
@@ -3590,7 +3598,9 @@ declare namespace ts {
function createArrayTypeNode(elementType: TypeNode): ArrayTypeNode;
function updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode;
function createTupleTypeNode(elementTypes: ReadonlyArray<TypeNode>): TupleTypeNode;
function updateTypleTypeNode(node: TupleTypeNode, elementTypes: ReadonlyArray<TypeNode>): TupleTypeNode;
function updateTupleTypeNode(node: TupleTypeNode, elementTypes: ReadonlyArray<TypeNode>): TupleTypeNode;
function createOptionalTypeNode(type: TypeNode): OptionalTypeNode;
function updateOptionalTypeNode(node: OptionalTypeNode, type: TypeNode): OptionalTypeNode;
function createUnionTypeNode(types: ReadonlyArray<TypeNode>): UnionTypeNode;
function updateUnionTypeNode(node: UnionTypeNode, types: NodeArray<TypeNode>): UnionTypeNode;
function createIntersectionTypeNode(types: ReadonlyArray<TypeNode>): IntersectionTypeNode;
+153 -143
View File
@@ -231,143 +231,144 @@ declare namespace ts {
TypeLiteral = 166,
ArrayType = 167,
TupleType = 168,
UnionType = 169,
IntersectionType = 170,
ConditionalType = 171,
InferType = 172,
ParenthesizedType = 173,
ThisType = 174,
TypeOperator = 175,
IndexedAccessType = 176,
MappedType = 177,
LiteralType = 178,
ImportType = 179,
ObjectBindingPattern = 180,
ArrayBindingPattern = 181,
BindingElement = 182,
ArrayLiteralExpression = 183,
ObjectLiteralExpression = 184,
PropertyAccessExpression = 185,
ElementAccessExpression = 186,
CallExpression = 187,
NewExpression = 188,
TaggedTemplateExpression = 189,
TypeAssertionExpression = 190,
ParenthesizedExpression = 191,
FunctionExpression = 192,
ArrowFunction = 193,
DeleteExpression = 194,
TypeOfExpression = 195,
VoidExpression = 196,
AwaitExpression = 197,
PrefixUnaryExpression = 198,
PostfixUnaryExpression = 199,
BinaryExpression = 200,
ConditionalExpression = 201,
TemplateExpression = 202,
YieldExpression = 203,
SpreadElement = 204,
ClassExpression = 205,
OmittedExpression = 206,
ExpressionWithTypeArguments = 207,
AsExpression = 208,
NonNullExpression = 209,
MetaProperty = 210,
TemplateSpan = 211,
SemicolonClassElement = 212,
Block = 213,
VariableStatement = 214,
EmptyStatement = 215,
ExpressionStatement = 216,
IfStatement = 217,
DoStatement = 218,
WhileStatement = 219,
ForStatement = 220,
ForInStatement = 221,
ForOfStatement = 222,
ContinueStatement = 223,
BreakStatement = 224,
ReturnStatement = 225,
WithStatement = 226,
SwitchStatement = 227,
LabeledStatement = 228,
ThrowStatement = 229,
TryStatement = 230,
DebuggerStatement = 231,
VariableDeclaration = 232,
VariableDeclarationList = 233,
FunctionDeclaration = 234,
ClassDeclaration = 235,
InterfaceDeclaration = 236,
TypeAliasDeclaration = 237,
EnumDeclaration = 238,
ModuleDeclaration = 239,
ModuleBlock = 240,
CaseBlock = 241,
NamespaceExportDeclaration = 242,
ImportEqualsDeclaration = 243,
ImportDeclaration = 244,
ImportClause = 245,
NamespaceImport = 246,
NamedImports = 247,
ImportSpecifier = 248,
ExportAssignment = 249,
ExportDeclaration = 250,
NamedExports = 251,
ExportSpecifier = 252,
MissingDeclaration = 253,
ExternalModuleReference = 254,
JsxElement = 255,
JsxSelfClosingElement = 256,
JsxOpeningElement = 257,
JsxClosingElement = 258,
JsxFragment = 259,
JsxOpeningFragment = 260,
JsxClosingFragment = 261,
JsxAttribute = 262,
JsxAttributes = 263,
JsxSpreadAttribute = 264,
JsxExpression = 265,
CaseClause = 266,
DefaultClause = 267,
HeritageClause = 268,
CatchClause = 269,
PropertyAssignment = 270,
ShorthandPropertyAssignment = 271,
SpreadAssignment = 272,
EnumMember = 273,
SourceFile = 274,
Bundle = 275,
UnparsedSource = 276,
InputFiles = 277,
JSDocTypeExpression = 278,
JSDocAllType = 279,
JSDocUnknownType = 280,
JSDocNullableType = 281,
JSDocNonNullableType = 282,
JSDocOptionalType = 283,
JSDocFunctionType = 284,
JSDocVariadicType = 285,
JSDocComment = 286,
JSDocTypeLiteral = 287,
JSDocSignature = 288,
JSDocTag = 289,
JSDocAugmentsTag = 290,
JSDocClassTag = 291,
JSDocCallbackTag = 292,
JSDocParameterTag = 293,
JSDocReturnTag = 294,
JSDocTypeTag = 295,
JSDocTemplateTag = 296,
JSDocTypedefTag = 297,
JSDocPropertyTag = 298,
SyntaxList = 299,
NotEmittedStatement = 300,
PartiallyEmittedExpression = 301,
CommaListExpression = 302,
MergeDeclarationMarker = 303,
EndOfDeclarationMarker = 304,
Count = 305,
OptionalType = 169,
UnionType = 170,
IntersectionType = 171,
ConditionalType = 172,
InferType = 173,
ParenthesizedType = 174,
ThisType = 175,
TypeOperator = 176,
IndexedAccessType = 177,
MappedType = 178,
LiteralType = 179,
ImportType = 180,
ObjectBindingPattern = 181,
ArrayBindingPattern = 182,
BindingElement = 183,
ArrayLiteralExpression = 184,
ObjectLiteralExpression = 185,
PropertyAccessExpression = 186,
ElementAccessExpression = 187,
CallExpression = 188,
NewExpression = 189,
TaggedTemplateExpression = 190,
TypeAssertionExpression = 191,
ParenthesizedExpression = 192,
FunctionExpression = 193,
ArrowFunction = 194,
DeleteExpression = 195,
TypeOfExpression = 196,
VoidExpression = 197,
AwaitExpression = 198,
PrefixUnaryExpression = 199,
PostfixUnaryExpression = 200,
BinaryExpression = 201,
ConditionalExpression = 202,
TemplateExpression = 203,
YieldExpression = 204,
SpreadElement = 205,
ClassExpression = 206,
OmittedExpression = 207,
ExpressionWithTypeArguments = 208,
AsExpression = 209,
NonNullExpression = 210,
MetaProperty = 211,
TemplateSpan = 212,
SemicolonClassElement = 213,
Block = 214,
VariableStatement = 215,
EmptyStatement = 216,
ExpressionStatement = 217,
IfStatement = 218,
DoStatement = 219,
WhileStatement = 220,
ForStatement = 221,
ForInStatement = 222,
ForOfStatement = 223,
ContinueStatement = 224,
BreakStatement = 225,
ReturnStatement = 226,
WithStatement = 227,
SwitchStatement = 228,
LabeledStatement = 229,
ThrowStatement = 230,
TryStatement = 231,
DebuggerStatement = 232,
VariableDeclaration = 233,
VariableDeclarationList = 234,
FunctionDeclaration = 235,
ClassDeclaration = 236,
InterfaceDeclaration = 237,
TypeAliasDeclaration = 238,
EnumDeclaration = 239,
ModuleDeclaration = 240,
ModuleBlock = 241,
CaseBlock = 242,
NamespaceExportDeclaration = 243,
ImportEqualsDeclaration = 244,
ImportDeclaration = 245,
ImportClause = 246,
NamespaceImport = 247,
NamedImports = 248,
ImportSpecifier = 249,
ExportAssignment = 250,
ExportDeclaration = 251,
NamedExports = 252,
ExportSpecifier = 253,
MissingDeclaration = 254,
ExternalModuleReference = 255,
JsxElement = 256,
JsxSelfClosingElement = 257,
JsxOpeningElement = 258,
JsxClosingElement = 259,
JsxFragment = 260,
JsxOpeningFragment = 261,
JsxClosingFragment = 262,
JsxAttribute = 263,
JsxAttributes = 264,
JsxSpreadAttribute = 265,
JsxExpression = 266,
CaseClause = 267,
DefaultClause = 268,
HeritageClause = 269,
CatchClause = 270,
PropertyAssignment = 271,
ShorthandPropertyAssignment = 272,
SpreadAssignment = 273,
EnumMember = 274,
SourceFile = 275,
Bundle = 276,
UnparsedSource = 277,
InputFiles = 278,
JSDocTypeExpression = 279,
JSDocAllType = 280,
JSDocUnknownType = 281,
JSDocNullableType = 282,
JSDocNonNullableType = 283,
JSDocOptionalType = 284,
JSDocFunctionType = 285,
JSDocVariadicType = 286,
JSDocComment = 287,
JSDocTypeLiteral = 288,
JSDocSignature = 289,
JSDocTag = 290,
JSDocAugmentsTag = 291,
JSDocClassTag = 292,
JSDocCallbackTag = 293,
JSDocParameterTag = 294,
JSDocReturnTag = 295,
JSDocTypeTag = 296,
JSDocTemplateTag = 297,
JSDocTypedefTag = 298,
JSDocPropertyTag = 299,
SyntaxList = 300,
NotEmittedStatement = 301,
PartiallyEmittedExpression = 302,
CommaListExpression = 303,
MergeDeclarationMarker = 304,
EndOfDeclarationMarker = 305,
Count = 306,
FirstAssignment = 58,
LastAssignment = 70,
FirstCompoundAssignment = 59,
@@ -379,7 +380,7 @@ declare namespace ts {
FirstFutureReservedWord = 108,
LastFutureReservedWord = 116,
FirstTypeNode = 161,
LastTypeNode = 179,
LastTypeNode = 180,
FirstPunctuation = 17,
LastPunctuation = 70,
FirstToken = 0,
@@ -393,10 +394,10 @@ declare namespace ts {
FirstBinaryOperator = 27,
LastBinaryOperator = 70,
FirstNode = 146,
FirstJSDocNode = 278,
LastJSDocNode = 298,
FirstJSDocTagNode = 289,
LastJSDocTagNode = 298
FirstJSDocNode = 279,
LastJSDocNode = 299,
FirstJSDocTagNode = 290,
LastJSDocTagNode = 299
}
enum NodeFlags {
None = 0,
@@ -751,6 +752,10 @@ declare namespace ts {
kind: SyntaxKind.TupleType;
elementTypes: NodeArray<TypeNode>;
}
interface OptionalTypeNode extends TypeNode {
kind: SyntaxKind.OptionalType;
type: TypeNode;
}
type UnionOrIntersectionTypeNode = UnionTypeNode | IntersectionTypeNode;
interface UnionTypeNode extends TypeNode {
kind: SyntaxKind.UnionType;
@@ -2249,6 +2254,9 @@ declare namespace ts {
}
interface GenericType extends InterfaceType, TypeReference {
}
interface TupleType extends GenericType {
minLength: number;
}
interface UnionOrIntersectionType extends Type {
types: Type[];
}
@@ -3590,7 +3598,9 @@ declare namespace ts {
function createArrayTypeNode(elementType: TypeNode): ArrayTypeNode;
function updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode;
function createTupleTypeNode(elementTypes: ReadonlyArray<TypeNode>): TupleTypeNode;
function updateTypleTypeNode(node: TupleTypeNode, elementTypes: ReadonlyArray<TypeNode>): TupleTypeNode;
function updateTupleTypeNode(node: TupleTypeNode, elementTypes: ReadonlyArray<TypeNode>): TupleTypeNode;
function createOptionalTypeNode(type: TypeNode): OptionalTypeNode;
function updateOptionalTypeNode(node: OptionalTypeNode, type: TypeNode): OptionalTypeNode;
function createUnionTypeNode(types: ReadonlyArray<TypeNode>): UnionTypeNode;
function updateUnionTypeNode(node: UnionTypeNode, types: NodeArray<TypeNode>): UnionTypeNode;
function createIntersectionTypeNode(types: ReadonlyArray<TypeNode>): IntersectionTypeNode;
@@ -1,5 +1,5 @@
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(10,5): error TS2322: Type 'undefined[]' is not assignable to type '[any, any, any]'.
Property '0' is missing in type 'undefined[]'.
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(10,5): error TS2322: Type '[]' is not assignable to type '[any, any, any]'.
Property '0' is missing in type '[]'.
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,5): error TS2322: Type '[string, number, boolean]' is not assignable to type '[boolean, string, number]'.
Type 'string' is not assignable to type 'boolean'.
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(17,5): error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'.
@@ -30,8 +30,8 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error
var a0: [any, any, any] = []; // Error
~~
!!! error TS2322: Type 'undefined[]' is not assignable to type '[any, any, any]'.
!!! error TS2322: Property '0' is missing in type 'undefined[]'.
!!! error TS2322: Type '[]' is not assignable to type '[any, any, any]'.
!!! error TS2322: Property '0' is missing in type '[]'.
var a1: [boolean, string, number] = ["string", 1, true]; // Error
~~
!!! error TS2322: Type '[string, number, boolean]' is not assignable to type '[boolean, string, number]'.
@@ -10,7 +10,7 @@
var a0: [any, any, any] = []; // Error
>a0 : [any, any, any]
>[] : undefined[]
>[] : []
var a1: [boolean, string, number] = ["string", 1, true]; // Error
>a1 : [boolean, string, number]
@@ -1,8 +0,0 @@
tests/cases/conformance/types/tuple/emptyTuples/emptyTuplesTypeAssertion01.ts(1,10): error TS1122: A tuple type element list cannot be empty.
==== tests/cases/conformance/types/tuple/emptyTuples/emptyTuplesTypeAssertion01.ts (1 errors) ====
let x = <[]>[];
~~
!!! error TS1122: A tuple type element list cannot be empty.
let y = x[0];
@@ -2,7 +2,7 @@
let x = <[]>[];
>x : []
><[]>[] : []
>[] : undefined[]
>[] : []
let y = x[0];
>y : never
@@ -1,8 +0,0 @@
tests/cases/conformance/types/tuple/emptyTuples/emptyTuplesTypeAssertion02.ts(1,15): error TS1122: A tuple type element list cannot be empty.
==== tests/cases/conformance/types/tuple/emptyTuples/emptyTuplesTypeAssertion02.ts (1 errors) ====
let x = [] as [];
~~
!!! error TS1122: A tuple type element list cannot be empty.
let y = x[0];
@@ -2,7 +2,7 @@
let x = [] as [];
>x : []
>[] as [] : []
>[] : undefined[]
>[] : []
let y = x[0];
>y : never
@@ -15,7 +15,6 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(35,21): error
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(36,21): error TS2538: Type 'boolean' cannot be used as an index type.
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(41,31): error TS2538: Type 'boolean' cannot be used as an index type.
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(46,16): error TS2538: Type 'boolean' cannot be used as an index type.
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(49,12): error TS1122: A tuple type element list cannot be empty.
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(63,33): error TS2345: Argument of type '"size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'.
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(64,33): error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'.
Type '"size"' is not assignable to type '"name" | "width" | "height" | "visible"'.
@@ -61,7 +60,7 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(117,5): error
Type 'T' is not assignable to type 'U'.
==== tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts (34 errors) ====
==== tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts (33 errors) ====
class Shape {
name: string;
width: number;
@@ -145,8 +144,6 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(117,5): error
type T60 = {}["toString"];
type T61 = []["toString"];
~~
!!! error TS1122: A tuple type element list cannot be empty.
declare let cond: boolean;
@@ -1,13 +1,10 @@
tests/cases/compiler/promiseEmptyTupleNoException.ts(1,38): error TS1122: A tuple type element list cannot be empty.
tests/cases/compiler/promiseEmptyTupleNoException.ts(3,3): error TS2322: Type 'any[]' is not assignable to type '[]'.
Types of property 'length' are incompatible.
Type 'number' is not assignable to type '0'.
==== tests/cases/compiler/promiseEmptyTupleNoException.ts (2 errors) ====
==== tests/cases/compiler/promiseEmptyTupleNoException.ts (1 errors) ====
export async function get(): Promise<[]> {
~~
!!! error TS1122: A tuple type element list cannot be empty.
let emails = [];
return emails;
~~~~~~~~~~~~~~
@@ -1,14 +1,11 @@
tests/cases/conformance/types/tuple/strictTupleLength.ts(1,9): error TS1122: A tuple type element list cannot be empty.
tests/cases/conformance/types/tuple/strictTupleLength.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 't1' must be of type '[number]', but here has type '[number, number]'.
tests/cases/conformance/types/tuple/strictTupleLength.ts(12,5): error TS2403: Subsequent variable declarations must have the same type. Variable 't2' must be of type '[number, number]', but here has type '[number]'.
tests/cases/conformance/types/tuple/strictTupleLength.ts(18,1): error TS2322: Type 'number[]' is not assignable to type '[number]'.
Property '0' is missing in type 'number[]'.
==== tests/cases/conformance/types/tuple/strictTupleLength.ts (4 errors) ====
==== tests/cases/conformance/types/tuple/strictTupleLength.ts (3 errors) ====
var t0: [];
~~
!!! error TS1122: A tuple type element list cannot be empty.
var t1: [number];
var t2: [number, number];
var arr: number[];
@@ -1,6 +1,5 @@
tests/cases/compiler/tupleTypes.ts(1,9): error TS1122: A tuple type element list cannot be empty.
tests/cases/compiler/tupleTypes.ts(14,1): error TS2322: Type 'undefined[]' is not assignable to type '[number, string]'.
Property '0' is missing in type 'undefined[]'.
tests/cases/compiler/tupleTypes.ts(14,1): error TS2322: Type '[]' is not assignable to type '[number, string]'.
Property '0' is missing in type '[]'.
tests/cases/compiler/tupleTypes.ts(15,1): error TS2322: Type '[number]' is not assignable to type '[number, string]'.
Property '1' is missing in type '[number]'.
tests/cases/compiler/tupleTypes.ts(17,1): error TS2322: Type '[string, number]' is not assignable to type '[number, string]'.
@@ -8,7 +7,7 @@ tests/cases/compiler/tupleTypes.ts(17,1): error TS2322: Type '[string, number]'
tests/cases/compiler/tupleTypes.ts(18,1): error TS2322: Type '[number, string, number]' is not assignable to type '[number, string]'.
Types of property 'length' are incompatible.
Type '3' is not assignable to type '2'.
tests/cases/compiler/tupleTypes.ts(41,1): error TS2322: Type 'undefined[]' is not assignable to type '[number, string]'.
tests/cases/compiler/tupleTypes.ts(41,1): error TS2322: Type '[]' is not assignable to type '[number, string]'.
tests/cases/compiler/tupleTypes.ts(47,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'.
Types of property 'pop' are incompatible.
Type '() => string | number' is not assignable to type '() => number'.
@@ -25,10 +24,8 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n
Type '{}' is not assignable to type 'string'.
==== tests/cases/compiler/tupleTypes.ts (10 errors) ====
==== tests/cases/compiler/tupleTypes.ts (9 errors) ====
var v1: []; // Error
~~
!!! error TS1122: A tuple type element list cannot be empty.
var v2: [number];
var v3: [number, string];
var v4: [number, [string, string]];
@@ -43,8 +40,8 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n
t = []; // Error
~
!!! error TS2322: Type 'undefined[]' is not assignable to type '[number, string]'.
!!! error TS2322: Property '0' is missing in type 'undefined[]'.
!!! error TS2322: Type '[]' is not assignable to type '[number, string]'.
!!! error TS2322: Property '0' is missing in type '[]'.
t = [1]; // Error
~
!!! error TS2322: Type '[number]' is not assignable to type '[number, string]'.
@@ -83,7 +80,7 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n
tt = [undefined, undefined];
tt = []; // Error
~~
!!! error TS2322: Type 'undefined[]' is not assignable to type '[number, string]'.
!!! error TS2322: Type '[]' is not assignable to type '[number, string]'.
var a: number[];
var a1: [number, string];
+4 -4
View File
@@ -42,9 +42,9 @@ var t2: number|string;
>t2 : string | number
t = []; // Error
>t = [] : undefined[]
>t = [] : []
>t : [number, string]
>[] : undefined[]
>[] : []
t = [1]; // Error
>t = [1] : [number]
@@ -188,9 +188,9 @@ tt = [undefined, undefined];
>undefined : undefined
tt = []; // Error
>tt = [] : undefined[]
>tt = [] : []
>tt : [number, string]
>[] : undefined[]
>[] : []
var a: number[];
>a : number[]