mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #9407 from Microsoft/literalTypes
Number, enum, and boolean literal types
This commit is contained in:
+4
-18
@@ -618,18 +618,10 @@ namespace ts {
|
||||
return false;
|
||||
}
|
||||
|
||||
function isNarrowingNullCheckOperands(expr1: Expression, expr2: Expression) {
|
||||
return (expr1.kind === SyntaxKind.NullKeyword || expr1.kind === SyntaxKind.Identifier && (<Identifier>expr1).text === "undefined") && isNarrowableOperand(expr2);
|
||||
}
|
||||
|
||||
function isNarrowingTypeofOperands(expr1: Expression, expr2: Expression) {
|
||||
return expr1.kind === SyntaxKind.TypeOfExpression && isNarrowableOperand((<TypeOfExpression>expr1).expression) && expr2.kind === SyntaxKind.StringLiteral;
|
||||
}
|
||||
|
||||
function isNarrowingDiscriminant(expr: Expression) {
|
||||
return expr.kind === SyntaxKind.PropertyAccessExpression && isNarrowableReference((<PropertyAccessExpression>expr).expression);
|
||||
}
|
||||
|
||||
function isNarrowingBinaryExpression(expr: BinaryExpression) {
|
||||
switch (expr.operatorToken.kind) {
|
||||
case SyntaxKind.EqualsToken:
|
||||
@@ -638,9 +630,8 @@ namespace ts {
|
||||
case SyntaxKind.ExclamationEqualsToken:
|
||||
case SyntaxKind.EqualsEqualsEqualsToken:
|
||||
case SyntaxKind.ExclamationEqualsEqualsToken:
|
||||
return isNarrowingNullCheckOperands(expr.right, expr.left) || isNarrowingNullCheckOperands(expr.left, expr.right) ||
|
||||
isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) ||
|
||||
isNarrowingDiscriminant(expr.left) || isNarrowingDiscriminant(expr.right);
|
||||
return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) ||
|
||||
isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right);
|
||||
case SyntaxKind.InstanceOfKeyword:
|
||||
return isNarrowableOperand(expr.left);
|
||||
case SyntaxKind.CommaToken:
|
||||
@@ -664,11 +655,6 @@ namespace ts {
|
||||
return isNarrowableReference(expr);
|
||||
}
|
||||
|
||||
function isNarrowingSwitchStatement(switchStatement: SwitchStatement) {
|
||||
const expr = switchStatement.expression;
|
||||
return expr.kind === SyntaxKind.PropertyAccessExpression && isNarrowableReference((<PropertyAccessExpression>expr).expression);
|
||||
}
|
||||
|
||||
function createBranchLabel(): FlowLabel {
|
||||
return {
|
||||
flags: FlowFlags.BranchLabel,
|
||||
@@ -718,7 +704,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function createFlowSwitchClause(antecedent: FlowNode, switchStatement: SwitchStatement, clauseStart: number, clauseEnd: number): FlowNode {
|
||||
if (!isNarrowingSwitchStatement(switchStatement)) {
|
||||
if (!isNarrowingExpression(switchStatement.expression)) {
|
||||
return antecedent;
|
||||
}
|
||||
setFlowNodeReferenced(antecedent);
|
||||
@@ -1983,7 +1969,7 @@ namespace ts {
|
||||
function bindThisPropertyAssignment(node: BinaryExpression) {
|
||||
// Declare a 'member' in case it turns out the container was an ES5 class or ES6 constructor
|
||||
let assignee: Node;
|
||||
if (container.kind === SyntaxKind.FunctionDeclaration || container.kind === SyntaxKind.FunctionDeclaration) {
|
||||
if (container.kind === SyntaxKind.FunctionDeclaration || container.kind === SyntaxKind.FunctionExpression) {
|
||||
assignee = container;
|
||||
}
|
||||
else if (container.kind === SyntaxKind.Constructor) {
|
||||
|
||||
+734
-377
File diff suppressed because it is too large
Load Diff
@@ -93,10 +93,10 @@ namespace ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function contains<T>(array: T[], value: T, areEqual?: (a: T, b: T) => boolean): boolean {
|
||||
export function contains<T>(array: T[], value: T): boolean {
|
||||
if (array) {
|
||||
for (const v of array) {
|
||||
if (areEqual ? areEqual(v, value) : v === value) {
|
||||
if (v === value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -182,10 +182,13 @@ namespace ts {
|
||||
let result: T[];
|
||||
if (array) {
|
||||
result = [];
|
||||
for (const item of array) {
|
||||
if (!contains(result, item, areEqual)) {
|
||||
result.push(item);
|
||||
loop: for (const item of array) {
|
||||
for (const res of result) {
|
||||
if (areEqual ? areEqual(res, item) : res === item) {
|
||||
continue loop;
|
||||
}
|
||||
}
|
||||
result.push(item);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -397,7 +397,7 @@ namespace ts {
|
||||
case SyntaxKind.NullKeyword:
|
||||
case SyntaxKind.NeverKeyword:
|
||||
case SyntaxKind.ThisType:
|
||||
case SyntaxKind.StringLiteralType:
|
||||
case SyntaxKind.LiteralType:
|
||||
return writeTextOfNode(currentText, type);
|
||||
case SyntaxKind.ExpressionWithTypeArguments:
|
||||
return emitExpressionWithTypeArguments(<ExpressionWithTypeArguments>type);
|
||||
|
||||
@@ -1755,6 +1755,10 @@
|
||||
"category": "Error",
|
||||
"code": 2534
|
||||
},
|
||||
"Enum type '{0}' has members with initializers that are not literals.": {
|
||||
"category": "Error",
|
||||
"code": 2535
|
||||
},
|
||||
"JSX element attributes type '{0}' may not be a union type.": {
|
||||
"category": "Error",
|
||||
"code": 2600
|
||||
|
||||
@@ -6045,7 +6045,7 @@ const _super = (function (geti, seti) {
|
||||
return;
|
||||
|
||||
case SyntaxKind.StringKeyword:
|
||||
case SyntaxKind.StringLiteralType:
|
||||
case SyntaxKind.LiteralType:
|
||||
write("String");
|
||||
return;
|
||||
|
||||
|
||||
+335
-306
File diff suppressed because it is too large
Load Diff
+66
-43
@@ -210,7 +210,7 @@ namespace ts {
|
||||
IntersectionType,
|
||||
ParenthesizedType,
|
||||
ThisType,
|
||||
StringLiteralType,
|
||||
LiteralType,
|
||||
// Binding patterns
|
||||
ObjectBindingPattern,
|
||||
ArrayBindingPattern,
|
||||
@@ -361,7 +361,7 @@ namespace ts {
|
||||
FirstFutureReservedWord = ImplementsKeyword,
|
||||
LastFutureReservedWord = YieldKeyword,
|
||||
FirstTypeNode = TypePredicate,
|
||||
LastTypeNode = StringLiteralType,
|
||||
LastTypeNode = LiteralType,
|
||||
FirstPunctuation = OpenBraceToken,
|
||||
LastPunctuation = CaretEqualsToken,
|
||||
FirstToken = Unknown,
|
||||
@@ -794,8 +794,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
// @kind(SyntaxKind.StringLiteralType)
|
||||
export interface StringLiteralTypeNode extends LiteralLikeNode, TypeNode {
|
||||
export interface LiteralTypeNode extends TypeNode {
|
||||
_stringLiteralTypeBrand: any;
|
||||
literal: Expression;
|
||||
}
|
||||
|
||||
// @kind(SyntaxKind.StringLiteral)
|
||||
@@ -1916,6 +1917,7 @@ namespace ts {
|
||||
InElementType = 0x00000040, // Writing an array or union element type
|
||||
UseFullyQualifiedType = 0x00000080, // Write out the fully qualified type name (eg. Module.Type, instead of Type)
|
||||
InFirstTypeArgument = 0x00000100, // Writing first type argument of the instantiated type
|
||||
InTypeAlias = 0x00000200, // Writing type in type alias declaration
|
||||
}
|
||||
|
||||
export const enum SymbolFormatFlags {
|
||||
@@ -2069,8 +2071,8 @@ namespace ts {
|
||||
Enum = RegularEnum | ConstEnum,
|
||||
Variable = FunctionScopedVariable | BlockScopedVariable,
|
||||
Value = Variable | Property | EnumMember | Function | Class | Enum | ValueModule | Method | GetAccessor | SetAccessor,
|
||||
Type = Class | Interface | Enum | TypeLiteral | ObjectLiteral | TypeParameter | TypeAlias,
|
||||
Namespace = ValueModule | NamespaceModule,
|
||||
Type = Class | Interface | Enum | EnumMember | TypeLiteral | ObjectLiteral | TypeParameter | TypeAlias,
|
||||
Namespace = ValueModule | NamespaceModule | Enum,
|
||||
Module = ValueModule | NamespaceModule,
|
||||
Accessor = GetAccessor | SetAccessor,
|
||||
|
||||
@@ -2084,7 +2086,7 @@ namespace ts {
|
||||
|
||||
ParameterExcludes = Value,
|
||||
PropertyExcludes = None,
|
||||
EnumMemberExcludes = Value,
|
||||
EnumMemberExcludes = Value | Type,
|
||||
FunctionExcludes = Value & ~(Function | ValueModule),
|
||||
ClassExcludes = (Value | Type) & ~(ValueModule | Interface), // class-interface mergability done in checker.ts
|
||||
InterfaceExcludes = Type & ~(Interface | Class),
|
||||
@@ -2215,57 +2217,65 @@ namespace ts {
|
||||
}
|
||||
|
||||
export const enum TypeFlags {
|
||||
Any = 0x00000001,
|
||||
String = 0x00000002,
|
||||
Number = 0x00000004,
|
||||
Boolean = 0x00000008,
|
||||
Void = 0x00000010,
|
||||
Undefined = 0x00000020,
|
||||
Null = 0x00000040,
|
||||
Enum = 0x00000080, // Enum type
|
||||
StringLiteral = 0x00000100, // String literal type
|
||||
TypeParameter = 0x00000200, // Type parameter
|
||||
Class = 0x00000400, // Class
|
||||
Interface = 0x00000800, // Interface
|
||||
Reference = 0x00001000, // Generic type reference
|
||||
Tuple = 0x00002000, // Tuple
|
||||
Union = 0x00004000, // Union (T | U)
|
||||
Intersection = 0x00008000, // Intersection (T & U)
|
||||
Anonymous = 0x00010000, // Anonymous
|
||||
Instantiated = 0x00020000, // Instantiated anonymous type
|
||||
Any = 1 << 0,
|
||||
String = 1 << 1,
|
||||
Number = 1 << 2,
|
||||
Boolean = 1 << 3,
|
||||
Enum = 1 << 4,
|
||||
StringLiteral = 1 << 5,
|
||||
NumberLiteral = 1 << 6,
|
||||
BooleanLiteral = 1 << 7,
|
||||
EnumLiteral = 1 << 8,
|
||||
ESSymbol = 1 << 9, // Type of symbol primitive introduced in ES6
|
||||
Void = 1 << 10,
|
||||
Undefined = 1 << 11,
|
||||
Null = 1 << 12,
|
||||
Never = 1 << 13, // Never type
|
||||
TypeParameter = 1 << 14, // Type parameter
|
||||
Class = 1 << 15, // Class
|
||||
Interface = 1 << 16, // Interface
|
||||
Reference = 1 << 17, // Generic type reference
|
||||
Tuple = 1 << 18, // Tuple
|
||||
Union = 1 << 19, // Union (T | U)
|
||||
Intersection = 1 << 20, // Intersection (T & U)
|
||||
Anonymous = 1 << 21, // Anonymous
|
||||
Instantiated = 1 << 22, // Instantiated anonymous type
|
||||
/* @internal */
|
||||
FromSignature = 0x00040000, // Created for signature assignment check
|
||||
ObjectLiteral = 0x00080000, // Originates in an object literal
|
||||
ObjectLiteral = 1 << 23, // Originates in an object literal
|
||||
/* @internal */
|
||||
FreshObjectLiteral = 0x00100000, // Fresh object literal type
|
||||
FreshObjectLiteral = 1 << 24, // Fresh object literal type
|
||||
/* @internal */
|
||||
ContainsWideningType = 0x00200000, // Type is or contains undefined or null widening type
|
||||
ContainsWideningType = 1 << 25, // Type is or contains undefined or null widening type
|
||||
/* @internal */
|
||||
ContainsObjectLiteral = 0x00400000, // Type is or contains object literal type
|
||||
ContainsObjectLiteral = 1 << 26, // Type is or contains object literal type
|
||||
/* @internal */
|
||||
ContainsAnyFunctionType = 0x00800000, // Type is or contains object literal type
|
||||
ESSymbol = 0x01000000, // Type of symbol primitive introduced in ES6
|
||||
ThisType = 0x02000000, // This type
|
||||
ObjectLiteralPatternWithComputedProperties = 0x04000000, // Object literal type implied by binding pattern has computed properties
|
||||
Never = 0x08000000, // Never type
|
||||
ContainsAnyFunctionType = 1 << 27, // Type is or contains object literal type
|
||||
ThisType = 1 << 28, // This type
|
||||
ObjectLiteralPatternWithComputedProperties = 1 << 29, // Object literal type implied by binding pattern has computed properties
|
||||
|
||||
/* @internal */
|
||||
Nullable = Undefined | Null,
|
||||
Literal = StringLiteral | NumberLiteral | BooleanLiteral | EnumLiteral,
|
||||
/* @internal */
|
||||
Falsy = Void | Undefined | Null, // TODO: Add false, 0, and ""
|
||||
DefinitelyFalsy = StringLiteral | NumberLiteral | BooleanLiteral | Void | Undefined | Null,
|
||||
PossiblyFalsy = DefinitelyFalsy | String | Number | Boolean,
|
||||
/* @internal */
|
||||
Intrinsic = Any | String | Number | Boolean | ESSymbol | Void | Undefined | Null | Never,
|
||||
Intrinsic = Any | String | Number | Boolean | BooleanLiteral | ESSymbol | Void | Undefined | Null | Never,
|
||||
/* @internal */
|
||||
Primitive = String | Number | Boolean | ESSymbol | Void | Undefined | Null | StringLiteral | Enum,
|
||||
Primitive = String | Number | Boolean | Enum | ESSymbol | Void | Undefined | Null | Literal,
|
||||
StringLike = String | StringLiteral,
|
||||
NumberLike = Number | Enum,
|
||||
NumberLike = Number | NumberLiteral | Enum | EnumLiteral,
|
||||
BooleanLike = Boolean | BooleanLiteral,
|
||||
EnumLike = Enum | EnumLiteral,
|
||||
ObjectType = Class | Interface | Reference | Tuple | Anonymous,
|
||||
UnionOrIntersection = Union | Intersection,
|
||||
StructuredType = ObjectType | Union | Intersection,
|
||||
StructuredOrTypeParameter = StructuredType | TypeParameter,
|
||||
|
||||
// 'Narrowable' types are types where narrowing actually narrows.
|
||||
// This *should* be every type other than null, undefined, void, and never
|
||||
Narrowable = Any | StructuredType | TypeParameter | StringLike | NumberLike | Boolean | ESSymbol,
|
||||
Narrowable = Any | StructuredType | TypeParameter | StringLike | NumberLike | BooleanLike | ESSymbol,
|
||||
NotUnionOrUnit = Any | String | Number | ESSymbol | ObjectType,
|
||||
/* @internal */
|
||||
RequiresWidening = ContainsWideningType | ContainsObjectLiteral,
|
||||
/* @internal */
|
||||
@@ -2280,6 +2290,8 @@ namespace ts {
|
||||
/* @internal */ id: number; // Unique ID
|
||||
symbol?: Symbol; // Symbol associated with type (if any)
|
||||
pattern?: DestructuringPattern; // Destructuring pattern represented by type (if any)
|
||||
aliasSymbol?: Symbol; // Alias associated with type
|
||||
aliasTypeArguments?: Type[]; // Alias type arguments (if any)
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
@@ -2289,10 +2301,20 @@ namespace ts {
|
||||
}
|
||||
|
||||
// String literal types (TypeFlags.StringLiteral)
|
||||
export interface StringLiteralType extends Type {
|
||||
export interface LiteralType extends Type {
|
||||
text: string; // Text of string literal
|
||||
}
|
||||
|
||||
// Enum types (TypeFlags.Enum)
|
||||
export interface EnumType extends Type {
|
||||
memberTypes: Map<EnumLiteralType>;
|
||||
}
|
||||
|
||||
// Enum types (TypeFlags.EnumLiteral)
|
||||
export interface EnumLiteralType extends LiteralType {
|
||||
baseType: EnumType & UnionType;
|
||||
}
|
||||
|
||||
// Object types (TypeFlags.ObjectType)
|
||||
export interface ObjectType extends Type { }
|
||||
|
||||
@@ -2342,9 +2364,9 @@ namespace ts {
|
||||
export interface UnionOrIntersectionType extends Type {
|
||||
types: Type[]; // Constituent types
|
||||
/* @internal */
|
||||
reducedType: Type; // Reduced union type (all subtypes removed)
|
||||
/* @internal */
|
||||
resolvedProperties: SymbolTable; // Cache of resolved properties
|
||||
/* @internal */
|
||||
couldContainTypeParameters: boolean;
|
||||
}
|
||||
|
||||
export interface UnionType extends UnionOrIntersectionType { }
|
||||
@@ -2413,7 +2435,7 @@ namespace ts {
|
||||
/* @internal */
|
||||
hasRestParameter: boolean; // True if last parameter is rest parameter
|
||||
/* @internal */
|
||||
hasStringLiterals: boolean; // True if specialized
|
||||
hasLiteralTypes: boolean; // True if specialized
|
||||
/* @internal */
|
||||
target?: Signature; // Instantiation target
|
||||
/* @internal */
|
||||
@@ -2443,6 +2465,7 @@ namespace ts {
|
||||
export interface TypeMapper {
|
||||
(t: TypeParameter): Type;
|
||||
mappedTypes?: Type[]; // Types mapped by this mapper
|
||||
targetTypes?: Type[]; // Types substituted for mapped types
|
||||
instantiations?: Type[]; // Cache of instantiations created using this type mapper.
|
||||
context?: InferenceContext; // The inference context this mapper was created from.
|
||||
// Only inference mappers have this set (in createInferenceMapper).
|
||||
|
||||
@@ -1523,7 +1523,7 @@ namespace ts {
|
||||
continue;
|
||||
}
|
||||
return parent.kind === SyntaxKind.BinaryExpression &&
|
||||
(<BinaryExpression>parent).operatorToken.kind === SyntaxKind.EqualsToken &&
|
||||
isAssignmentOperator((<BinaryExpression>parent).operatorToken.kind) &&
|
||||
(<BinaryExpression>parent).left === node ||
|
||||
(parent.kind === SyntaxKind.ForInStatement || parent.kind === SyntaxKind.ForOfStatement) &&
|
||||
(<ForInStatement | ForOfStatement>parent).initializer === node;
|
||||
|
||||
@@ -209,7 +209,7 @@ namespace Playback {
|
||||
memoize(path => findResultByFields(replayLog.pathsResolved, { path }, !ts.isRootedDiskPath(ts.normalizeSlashes(path)) && replayLog.currentDirectory ? replayLog.currentDirectory + "/" + path : ts.normalizeSlashes(path))));
|
||||
|
||||
wrapper.readFile = recordReplay(wrapper.readFile, underlying)(
|
||||
path => {
|
||||
(path: string) => {
|
||||
const result = underlying.readFile(path);
|
||||
const logEntry = { path, codepage: 0, result: { contents: result, codepage: 0 } };
|
||||
recordLog.filesRead.push(logEntry);
|
||||
|
||||
@@ -871,7 +871,7 @@ namespace ts {
|
||||
resolvedReturnType: Type;
|
||||
minArgumentCount: number;
|
||||
hasRestParameter: boolean;
|
||||
hasStringLiterals: boolean;
|
||||
hasLiteralTypes: boolean;
|
||||
|
||||
// Undefined is used to indicate the value has not been computed. If, after computing, the
|
||||
// symbol has no doc comment, then the empty string will be returned.
|
||||
@@ -3731,7 +3731,6 @@ namespace ts {
|
||||
|
||||
function isInStringOrRegularExpressionOrTemplateLiteral(contextToken: Node): boolean {
|
||||
if (contextToken.kind === SyntaxKind.StringLiteral
|
||||
|| contextToken.kind === SyntaxKind.StringLiteralType
|
||||
|| contextToken.kind === SyntaxKind.RegularExpressionLiteral
|
||||
|| isTemplateLiteralKind(contextToken.kind)) {
|
||||
const start = contextToken.getStart();
|
||||
@@ -4433,7 +4432,7 @@ namespace ts {
|
||||
else {
|
||||
if (type.flags & TypeFlags.StringLiteral) {
|
||||
result.push({
|
||||
name: (<StringLiteralType>type).text,
|
||||
name: (<LiteralType>type).text,
|
||||
kindModifiers: ScriptElementKindModifier.none,
|
||||
kind: ScriptElementKind.variableElement,
|
||||
sortText: "0"
|
||||
@@ -4734,7 +4733,7 @@ namespace ts {
|
||||
displayParts.push(spacePart());
|
||||
displayParts.push(operatorPart(SyntaxKind.EqualsToken));
|
||||
displayParts.push(spacePart());
|
||||
addRange(displayParts, typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration));
|
||||
addRange(displayParts, typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, TypeFormatFlags.InTypeAlias));
|
||||
}
|
||||
if (symbolFlags & SymbolFlags.Enum) {
|
||||
addNewLineIfDisplayPartsExist();
|
||||
@@ -5221,7 +5220,7 @@ namespace ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (type.flags & TypeFlags.Union) {
|
||||
if (type.flags & TypeFlags.Union && !(type.flags & TypeFlags.Enum)) {
|
||||
const result: DefinitionInfo[] = [];
|
||||
forEach((<UnionType>type).types, t => {
|
||||
if (t.symbol) {
|
||||
@@ -7135,7 +7134,6 @@ namespace ts {
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
case SyntaxKind.QualifiedName:
|
||||
case SyntaxKind.StringLiteral:
|
||||
case SyntaxKind.StringLiteralType:
|
||||
case SyntaxKind.FalseKeyword:
|
||||
case SyntaxKind.TrueKeyword:
|
||||
case SyntaxKind.NullKeyword:
|
||||
@@ -7639,7 +7637,7 @@ namespace ts {
|
||||
else if (tokenKind === SyntaxKind.NumericLiteral) {
|
||||
return ClassificationType.numericLiteral;
|
||||
}
|
||||
else if (tokenKind === SyntaxKind.StringLiteral || tokenKind === SyntaxKind.StringLiteralType) {
|
||||
else if (tokenKind === SyntaxKind.StringLiteral) {
|
||||
return token.parent.kind === SyntaxKind.JsxAttribute ? ClassificationType.jsxAttributeStringLiteralValue : ClassificationType.stringLiteral;
|
||||
}
|
||||
else if (tokenKind === SyntaxKind.RegularExpressionLiteral) {
|
||||
@@ -8134,11 +8132,11 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function getStringLiteralTypeForNode(node: StringLiteral | StringLiteralTypeNode, typeChecker: TypeChecker): StringLiteralType {
|
||||
const searchNode = node.parent.kind === SyntaxKind.StringLiteralType ? <StringLiteralTypeNode>node.parent : node;
|
||||
function getStringLiteralTypeForNode(node: StringLiteral | LiteralTypeNode, typeChecker: TypeChecker): LiteralType {
|
||||
const searchNode = node.parent.kind === SyntaxKind.LiteralType ? <LiteralTypeNode>node.parent : node;
|
||||
const type = typeChecker.getTypeAtLocation(searchNode);
|
||||
if (type && type.flags & TypeFlags.StringLiteral) {
|
||||
return <StringLiteralType>type;
|
||||
return <LiteralType>type;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
@@ -8625,7 +8623,7 @@ namespace ts {
|
||||
addResult(start, end, classFromKind(token));
|
||||
|
||||
if (end >= text.length) {
|
||||
if (token === SyntaxKind.StringLiteral || token === SyntaxKind.StringLiteralType) {
|
||||
if (token === SyntaxKind.StringLiteral) {
|
||||
// Check to see if we finished up on a multiline string literal.
|
||||
const tokenText = scanner.getTokenText();
|
||||
if (scanner.isUnterminated()) {
|
||||
@@ -8775,7 +8773,6 @@ namespace ts {
|
||||
case SyntaxKind.NumericLiteral:
|
||||
return ClassificationType.numericLiteral;
|
||||
case SyntaxKind.StringLiteral:
|
||||
case SyntaxKind.StringLiteralType:
|
||||
return ClassificationType.stringLiteral;
|
||||
case SyntaxKind.RegularExpressionLiteral:
|
||||
return ClassificationType.regularExpressionLiteral;
|
||||
|
||||
@@ -434,8 +434,7 @@ namespace ts {
|
||||
|
||||
export function isInString(sourceFile: SourceFile, position: number): boolean {
|
||||
const previousToken = findPrecedingToken(position, sourceFile);
|
||||
if (previousToken &&
|
||||
(previousToken.kind === SyntaxKind.StringLiteral || previousToken.kind === SyntaxKind.StringLiteralType)) {
|
||||
if (previousToken && previousToken.kind === SyntaxKind.StringLiteral) {
|
||||
const start = previousToken.getStart();
|
||||
const end = previousToken.getEnd();
|
||||
|
||||
@@ -633,7 +632,6 @@ namespace ts {
|
||||
|
||||
export function isStringOrRegularExpressionOrTemplateLiteral(kind: SyntaxKind): boolean {
|
||||
if (kind === SyntaxKind.StringLiteral
|
||||
|| kind === SyntaxKind.StringLiteralType
|
||||
|| kind === SyntaxKind.RegularExpressionLiteral
|
||||
|| isTemplateLiteralKind(kind)) {
|
||||
return true;
|
||||
@@ -922,7 +920,7 @@ namespace ts {
|
||||
if (host && host.getScriptKind) {
|
||||
scriptKind = host.getScriptKind(fileName);
|
||||
}
|
||||
if (!scriptKind || scriptKind === ScriptKind.Unknown) {
|
||||
if (!scriptKind) {
|
||||
scriptKind = getScriptKindFromFileName(fileName);
|
||||
}
|
||||
return ensureScriptKind(fileName, scriptKind);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,6): error TS2461: Type 'number | string' is not an array type.
|
||||
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,6): error TS2461: Type 'string | number' is not an array type.
|
||||
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,7): error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
|
||||
@@ -8,7 +8,7 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error
|
||||
var tuple: [number, string] = [2, "3"];
|
||||
for ([a = 1, b = ""] of tuple) {
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2461: Type 'number | string' is not an array type.
|
||||
!!! error TS2461: Type 'string | number' is not an array type.
|
||||
~
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
~
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck11.ts(3,6): error TS2322: Type 'number | string' is not assignable to type 'string'.
|
||||
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck11.ts(3,6): error TS2322: Type 'string | number' is not assignable to type 'string'.
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
|
||||
|
||||
@@ -7,5 +7,5 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck11.ts(3,6)
|
||||
var v: string;
|
||||
for (v of union) { }
|
||||
~
|
||||
!!! error TS2322: Type 'number | string' is not assignable to type 'string'.
|
||||
!!! error TS2322: Type 'string | number' is not assignable to type 'string'.
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
@@ -3,6 +3,6 @@ var union: string | number[];
|
||||
>union : string | number[]
|
||||
|
||||
for (var v of union) { }
|
||||
>v : number | string
|
||||
>v : string | number
|
||||
>union : string | number[]
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck9.ts(2,15): error TS2461: Type 'string[] | number | symbol' is not an array type.
|
||||
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck9.ts(2,15): error TS2461: Type 'number | symbol | string[]' is not an array type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck9.ts (1 errors) ====
|
||||
var union: string | string[] | number | symbol;
|
||||
for (let v of union) { }
|
||||
~~~~~
|
||||
!!! error TS2461: Type 'string[] | number | symbol' is not an array type.
|
||||
!!! error TS2461: Type 'number | symbol | string[]' is not an array type.
|
||||
@@ -18,7 +18,7 @@ for (let num of array) {
|
||||
if (sum === 0) {
|
||||
>sum === 0 : boolean
|
||||
>sum : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
array = [4,5,6]
|
||||
>array = [4,5,6] : number[]
|
||||
|
||||
@@ -6,15 +6,15 @@ enum Color { R, G, B }
|
||||
>B : Color
|
||||
|
||||
function f1(x: Color | string) {
|
||||
>f1 : (x: Color | string) => void
|
||||
>x : Color | string
|
||||
>f1 : (x: string | Color) => void
|
||||
>x : string | Color
|
||||
>Color : Color
|
||||
|
||||
if (typeof x === "number") {
|
||||
>typeof x === "number" : boolean
|
||||
>typeof x : string
|
||||
>x : Color | string
|
||||
>"number" : string
|
||||
>x : string | Color
|
||||
>"number" : "number"
|
||||
|
||||
var y = x;
|
||||
>y : Color
|
||||
@@ -35,15 +35,15 @@ function f1(x: Color | string) {
|
||||
}
|
||||
|
||||
function f2(x: Color | string | string[]) {
|
||||
>f2 : (x: Color | string | string[]) => void
|
||||
>x : Color | string | string[]
|
||||
>f2 : (x: string | Color | string[]) => void
|
||||
>x : string | Color | string[]
|
||||
>Color : Color
|
||||
|
||||
if (typeof x === "object") {
|
||||
>typeof x === "object" : boolean
|
||||
>typeof x : string
|
||||
>x : Color | string | string[]
|
||||
>"object" : string
|
||||
>x : string | Color | string[]
|
||||
>"object" : "object"
|
||||
|
||||
var y = x;
|
||||
>y : string[]
|
||||
@@ -55,8 +55,8 @@ function f2(x: Color | string | string[]) {
|
||||
if (typeof x === "number") {
|
||||
>typeof x === "number" : boolean
|
||||
>typeof x : string
|
||||
>x : string[] | Color | string
|
||||
>"number" : string
|
||||
>x : string | Color | string[]
|
||||
>"number" : "number"
|
||||
|
||||
var z = x;
|
||||
>z : Color
|
||||
@@ -68,17 +68,17 @@ function f2(x: Color | string | string[]) {
|
||||
}
|
||||
else {
|
||||
var w = x;
|
||||
>w : string[] | string
|
||||
>x : string[] | string
|
||||
>w : string | string[]
|
||||
>x : string | string[]
|
||||
|
||||
var w: string | string[];
|
||||
>w : string[] | string
|
||||
>w : string | string[]
|
||||
}
|
||||
if (typeof x === "string") {
|
||||
>typeof x === "string" : boolean
|
||||
>typeof x : string
|
||||
>x : Color | string[] | string
|
||||
>"string" : string
|
||||
>x : string | Color | string[]
|
||||
>"string" : "string"
|
||||
|
||||
var a = x;
|
||||
>a : string
|
||||
|
||||
@@ -34,7 +34,7 @@ var d2: IHasVisualizationModel = i || moduleA;
|
||||
var d2: IHasVisualizationModel = moduleA || i;
|
||||
>d2 : IHasVisualizationModel
|
||||
>IHasVisualizationModel : IHasVisualizationModel
|
||||
>moduleA || i : typeof moduleA
|
||||
>moduleA || i : IHasVisualizationModel
|
||||
>moduleA : typeof moduleA
|
||||
>i : IHasVisualizationModel
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@ import foo = require("./foo_0");
|
||||
|
||||
if(foo.E1.A === 0){
|
||||
>foo.E1.A === 0 : boolean
|
||||
>foo.E1.A : foo.E1
|
||||
>foo.E1.A : foo.E1.A
|
||||
>foo.E1 : typeof foo.E1
|
||||
>foo : typeof foo
|
||||
>E1 : typeof foo.E1
|
||||
>A : foo.E1
|
||||
>0 : number
|
||||
>A : foo.E1.A
|
||||
>0 : 0
|
||||
|
||||
// Should cause runtime import - interesting optimization possibility, as gets inlined to 0.
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ var e: number = <foo.E1>0;
|
||||
><foo.E1>0 : foo.E1
|
||||
>foo : any
|
||||
>E1 : foo.E1
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo_0.ts ===
|
||||
export class C1 {
|
||||
|
||||
@@ -6,5 +6,5 @@ function f() {
|
||||
>typeof class {} === "function" : boolean
|
||||
>typeof class {} : string
|
||||
>class {} : typeof (Anonymous class)
|
||||
>"function" : string
|
||||
>"function" : "function"
|
||||
}
|
||||
|
||||
@@ -366,22 +366,22 @@ module EmptyTypes {
|
||||
>base2 : typeof base2
|
||||
|
||||
var b1 = [baseObj, base2Obj, ifaceObj];
|
||||
>b1 : base[]
|
||||
>[baseObj, base2Obj, ifaceObj] : base[]
|
||||
>b1 : iface[]
|
||||
>[baseObj, base2Obj, ifaceObj] : iface[]
|
||||
>baseObj : base
|
||||
>base2Obj : base2
|
||||
>ifaceObj : iface
|
||||
|
||||
var b2 = [base2Obj, baseObj, ifaceObj];
|
||||
>b2 : base2[]
|
||||
>[base2Obj, baseObj, ifaceObj] : base2[]
|
||||
>b2 : iface[]
|
||||
>[base2Obj, baseObj, ifaceObj] : iface[]
|
||||
>base2Obj : base2
|
||||
>baseObj : base
|
||||
>ifaceObj : iface
|
||||
|
||||
var b3 = [baseObj, ifaceObj, base2Obj];
|
||||
>b3 : base[]
|
||||
>[baseObj, ifaceObj, base2Obj] : base[]
|
||||
>b3 : iface[]
|
||||
>[baseObj, ifaceObj, base2Obj] : iface[]
|
||||
>baseObj : base
|
||||
>ifaceObj : iface
|
||||
>base2Obj : base2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=== tests/cases/compiler/arrayLiteralComments.ts ===
|
||||
var testArrayWithFunc = [
|
||||
>testArrayWithFunc : ((() => void) | string | number | { a: number; } | number[])[]
|
||||
>[ // Function comment function() { let x = 1; }, // String comment '1', // Numeric comment 2, // Object comment { a: 1 }, // Array comment [1, 2, 3]] : ((() => void) | string | number | { a: number; } | number[])[]
|
||||
>testArrayWithFunc : (string | number | (() => void) | number[] | { a: number; })[]
|
||||
>[ // Function comment function() { let x = 1; }, // String comment '1', // Numeric comment 2, // Object comment { a: 1 }, // Array comment [1, 2, 3]] : (string | number | (() => void) | number[] | { a: number; })[]
|
||||
|
||||
// Function comment
|
||||
function() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(8,5): error TS2322: Type '[number, number, number, string]' is not assignable to type '[number, number, number]'.
|
||||
Types of property 'pop' are incompatible.
|
||||
Type '() => number | string' is not assignable to type '() => number'.
|
||||
Type 'number | string' is not assignable to type 'number'.
|
||||
Type '() => string | number' is not assignable to type '() => number'.
|
||||
Type 'string | number' is not assignable to type 'number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(14,5): error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'.
|
||||
Property '0' is missing in type 'number[]'.
|
||||
@@ -19,8 +19,8 @@ tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionConte
|
||||
~~~~
|
||||
!!! error TS2322: Type '[number, number, number, string]' is not assignable to type '[number, number, number]'.
|
||||
!!! error TS2322: Types of property 'pop' are incompatible.
|
||||
!!! error TS2322: Type '() => number | string' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Type 'number | string' is not assignable to type 'number'.
|
||||
!!! error TS2322: Type '() => string | number' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Type 'string | number' is not assignable to type 'number'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
|
||||
// In a contextually typed array literal expression containing one or more spread elements,
|
||||
|
||||
@@ -23,8 +23,8 @@ var as = [a, b]; // { x: number; y?: number };[]
|
||||
>b : { x: number; z?: number; }
|
||||
|
||||
var bs = [b, a]; // { x: number; z?: number };[]
|
||||
>bs : ({ x: number; z?: number; } | { x: number; y?: number; })[]
|
||||
>[b, a] : ({ x: number; z?: number; } | { x: number; y?: number; })[]
|
||||
>bs : ({ x: number; y?: number; } | { x: number; z?: number; })[]
|
||||
>[b, a] : ({ x: number; y?: number; } | { x: number; z?: number; })[]
|
||||
>b : { x: number; z?: number; }
|
||||
>a : { x: number; y?: number; }
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ var a1 = ["hello", "world"]
|
||||
>"world" : string
|
||||
|
||||
var a2 = [, , , ...a0, "hello"];
|
||||
>a2 : (number | string)[]
|
||||
>[, , , ...a0, "hello"] : (number | string)[]
|
||||
>a2 : (string | number)[]
|
||||
>[, , , ...a0, "hello"] : (string | number)[]
|
||||
> : undefined
|
||||
> : undefined
|
||||
> : undefined
|
||||
@@ -151,8 +151,8 @@ interface myArray2 extends Array<Number|String> { }
|
||||
>String : String
|
||||
|
||||
var d0 = [1, true, ...temp,]; // has type (string|number|boolean)[]
|
||||
>d0 : (number | boolean | string)[]
|
||||
>[1, true, ...temp,] : (number | boolean | string)[]
|
||||
>d0 : (string | number | boolean)[]
|
||||
>[1, true, ...temp,] : (string | number | boolean)[]
|
||||
>1 : number
|
||||
>true : boolean
|
||||
>...temp : string
|
||||
@@ -214,8 +214,8 @@ var d8: number[][] = [[...temp1]]
|
||||
>temp1 : number[]
|
||||
|
||||
var d9 = [[...temp1], ...["hello"]];
|
||||
>d9 : (number[] | string)[]
|
||||
>[[...temp1], ...["hello"]] : (number[] | string)[]
|
||||
>d9 : (string | number[])[]
|
||||
>[[...temp1], ...["hello"]] : (string | number[])[]
|
||||
>[...temp1] : number[]
|
||||
>...temp1 : number
|
||||
>temp1 : number[]
|
||||
|
||||
@@ -24,8 +24,8 @@ var a1 = ["hello", "world"]
|
||||
>"world" : string
|
||||
|
||||
var a2 = [, , , ...a0, "hello"];
|
||||
>a2 : (number | string)[]
|
||||
>[, , , ...a0, "hello"] : (number | string)[]
|
||||
>a2 : (string | number)[]
|
||||
>[, , , ...a0, "hello"] : (string | number)[]
|
||||
> : undefined
|
||||
> : undefined
|
||||
> : undefined
|
||||
@@ -140,8 +140,8 @@ interface myArray2 extends Array<Number|String> { }
|
||||
>String : String
|
||||
|
||||
var d0 = [1, true, ...temp, ]; // has type (string|number|boolean)[]
|
||||
>d0 : (number | boolean | string)[]
|
||||
>[1, true, ...temp, ] : (number | boolean | string)[]
|
||||
>d0 : (string | number | boolean)[]
|
||||
>[1, true, ...temp, ] : (string | number | boolean)[]
|
||||
>1 : number
|
||||
>true : boolean
|
||||
>...temp : string
|
||||
@@ -176,10 +176,10 @@ var d4: myArray2 = [...temp, ...temp1];
|
||||
>temp1 : number[]
|
||||
|
||||
var d5 = [...a2];
|
||||
>d5 : (number | string)[]
|
||||
>[...a2] : (number | string)[]
|
||||
>...a2 : number | string
|
||||
>a2 : (number | string)[]
|
||||
>d5 : (string | number)[]
|
||||
>[...a2] : (string | number)[]
|
||||
>...a2 : string | number
|
||||
>a2 : (string | number)[]
|
||||
|
||||
var d6 = [...a3];
|
||||
>d6 : number[]
|
||||
@@ -201,8 +201,8 @@ var d8: number[][] = [[...temp1]]
|
||||
>temp1 : number[]
|
||||
|
||||
var d9 = [[...temp1], ...["hello"]];
|
||||
>d9 : (number[] | string)[]
|
||||
>[[...temp1], ...["hello"]] : (number[] | string)[]
|
||||
>d9 : (string | number[])[]
|
||||
>[[...temp1], ...["hello"]] : (string | number[])[]
|
||||
>[...temp1] : number[]
|
||||
>...temp1 : number
|
||||
>temp1 : number[]
|
||||
|
||||
@@ -5,19 +5,19 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,5): error
|
||||
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]'.
|
||||
Types of property 'pop' are incompatible.
|
||||
Type '() => number | string | boolean' is not assignable to type '() => number'.
|
||||
Type 'number | string | boolean' is not assignable to type 'number'.
|
||||
Type '() => string | number | boolean' is not assignable to type '() => number'.
|
||||
Type 'string | number | boolean' is not assignable to type 'number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(32,5): error TS2322: Type '(number[] | string[])[]' is not assignable to type 'tup'.
|
||||
Property '0' is missing in type '(number[] | string[])[]'.
|
||||
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(33,5): error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'.
|
||||
Property '0' is missing in type 'number[]'.
|
||||
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error TS2322: Type '(number | string)[]' is not assignable to type 'myArray'.
|
||||
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error TS2322: Type '(string | number)[]' is not assignable to type 'myArray'.
|
||||
Types of property 'push' are incompatible.
|
||||
Type '(...items: (number | string)[]) => number' is not assignable to type '(...items: Number[]) => number'.
|
||||
Type '(...items: (string | number)[]) => number' is not assignable to type '(...items: Number[]) => number'.
|
||||
Types of parameters 'items' and 'items' are incompatible.
|
||||
Type 'Number' is not assignable to type 'number | string'.
|
||||
Type 'Number' is not assignable to type 'string'.
|
||||
Type 'Number' is not assignable to type 'string | number'.
|
||||
Type 'Number' is not assignable to type 'number'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts (6 errors) ====
|
||||
@@ -48,8 +48,8 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error
|
||||
~~~~~~~~
|
||||
!!! error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'.
|
||||
!!! error TS2322: Types of property 'pop' are incompatible.
|
||||
!!! error TS2322: Type '() => number | string | boolean' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Type 'number | string | boolean' is not assignable to type 'number'.
|
||||
!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'number'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
|
||||
// The resulting type an array literal expression is determined as follows:
|
||||
@@ -75,10 +75,10 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error
|
||||
!!! error TS2322: Property '0' is missing in type 'number[]'.
|
||||
var c2: myArray = [...temp1, ...temp]; // Error cannot assign (number|string)[] to number[]
|
||||
~~
|
||||
!!! error TS2322: Type '(number | string)[]' is not assignable to type 'myArray'.
|
||||
!!! error TS2322: Type '(string | number)[]' is not assignable to type 'myArray'.
|
||||
!!! error TS2322: Types of property 'push' are incompatible.
|
||||
!!! error TS2322: Type '(...items: (number | string)[]) => number' is not assignable to type '(...items: Number[]) => number'.
|
||||
!!! error TS2322: Type '(...items: (string | number)[]) => number' is not assignable to type '(...items: Number[]) => number'.
|
||||
!!! error TS2322: Types of parameters 'items' and 'items' are incompatible.
|
||||
!!! error TS2322: Type 'Number' is not assignable to type 'number | string'.
|
||||
!!! error TS2322: Type 'Number' is not assignable to type 'string'.
|
||||
!!! error TS2322: Type 'Number' is not assignable to type 'string | number'.
|
||||
!!! error TS2322: Type 'Number' is not assignable to type 'number'.
|
||||
|
||||
@@ -24,12 +24,12 @@ var z = Date as any as string;
|
||||
|
||||
// Should parse as a union type, not a bitwise 'or' of (32 as number) and 'string'
|
||||
var j = 32 as number|string;
|
||||
>j : number | string
|
||||
>32 as number|string : number | string
|
||||
>j : string | number
|
||||
>32 as number|string : string | number
|
||||
>32 : number
|
||||
|
||||
j = '';
|
||||
>j = '' : string
|
||||
>j : number | string
|
||||
>j : string | number
|
||||
>'' : string
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(17,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'.
|
||||
Types of property 'pop' are incompatible.
|
||||
Type '() => number | string' is not assignable to type '() => number'.
|
||||
Type 'number | string' is not assignable to type 'number'.
|
||||
Type '() => string | number' is not assignable to type '() => number'.
|
||||
Type 'string | number' is not assignable to type 'number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2322: Type '{}[]' is not assignable to type '[{}]'.
|
||||
Property '0' is missing in type '{}[]'.
|
||||
@@ -28,8 +28,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
|
||||
~~~~~~~~
|
||||
!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]'.
|
||||
!!! error TS2322: Types of property 'pop' are incompatible.
|
||||
!!! error TS2322: Type '() => number | string' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Type 'number | string' is not assignable to type 'number'.
|
||||
!!! error TS2322: Type '() => string | number' is not assignable to type '() => number'.
|
||||
!!! error TS2322: Type 'string | number' is not assignable to type 'number'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
emptyObjTuple = emptyObjArray;
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
@@ -19,14 +19,14 @@ function foo<T extends number>(x: T) {
|
||||
foo(5);
|
||||
>foo(5) : void
|
||||
>foo : <T extends number>(x: T) => void
|
||||
>5 : number
|
||||
>5 : 5
|
||||
|
||||
foo(E.A);
|
||||
>foo(E.A) : void
|
||||
>foo : <T extends number>(x: T) => void
|
||||
>E.A : E
|
||||
>E.A : E.A
|
||||
>E : typeof E
|
||||
>A : E
|
||||
>A : E.A
|
||||
|
||||
class A { a }
|
||||
>A : A
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
=== tests/cases/conformance/async/es6/awaitUnion_es6.ts ===
|
||||
declare let a: number | string;
|
||||
>a : number | string
|
||||
>a : string | number
|
||||
|
||||
declare let b: PromiseLike<number> | PromiseLike<string>;
|
||||
>b : PromiseLike<number> | PromiseLike<string>
|
||||
@@ -8,7 +8,7 @@ declare let b: PromiseLike<number> | PromiseLike<string>;
|
||||
>PromiseLike : PromiseLike<T>
|
||||
|
||||
declare let c: PromiseLike<number | string>;
|
||||
>c : PromiseLike<number | string>
|
||||
>c : PromiseLike<string | number>
|
||||
>PromiseLike : PromiseLike<T>
|
||||
|
||||
declare let d: number | PromiseLike<string>;
|
||||
@@ -16,34 +16,34 @@ declare let d: number | PromiseLike<string>;
|
||||
>PromiseLike : PromiseLike<T>
|
||||
|
||||
declare let e: number | PromiseLike<number | string>;
|
||||
>e : number | PromiseLike<number | string>
|
||||
>e : number | PromiseLike<string | number>
|
||||
>PromiseLike : PromiseLike<T>
|
||||
|
||||
async function f() {
|
||||
>f : () => Promise<void>
|
||||
|
||||
let await_a = await a;
|
||||
>await_a : number | string
|
||||
>await a : number | string
|
||||
>a : number | string
|
||||
>await_a : string | number
|
||||
>await a : string | number
|
||||
>a : string | number
|
||||
|
||||
let await_b = await b;
|
||||
>await_b : number | string
|
||||
>await b : number | string
|
||||
>await_b : string | number
|
||||
>await b : string | number
|
||||
>b : PromiseLike<number> | PromiseLike<string>
|
||||
|
||||
let await_c = await c;
|
||||
>await_c : number | string
|
||||
>await c : number | string
|
||||
>c : PromiseLike<number | string>
|
||||
>await_c : string | number
|
||||
>await c : string | number
|
||||
>c : PromiseLike<string | number>
|
||||
|
||||
let await_d = await d;
|
||||
>await_d : number | string
|
||||
>await d : number | string
|
||||
>await_d : string | number
|
||||
>await d : string | number
|
||||
>d : number | PromiseLike<string>
|
||||
|
||||
let await_e = await e;
|
||||
>await_e : number | string
|
||||
>await e : number | string
|
||||
>e : number | PromiseLike<number | string>
|
||||
>await_e : string | number
|
||||
>await e : string | number
|
||||
>e : number | PromiseLike<string | number>
|
||||
}
|
||||
|
||||
@@ -60,8 +60,8 @@ var r4 = true ? a : b; // typeof a
|
||||
>b : { x: number; z?: number; }
|
||||
|
||||
var r5 = true ? b : a; // typeof b
|
||||
>r5 : { x: number; z?: number; } | { x: number; y?: number; }
|
||||
>true ? b : a : { x: number; z?: number; } | { x: number; y?: number; }
|
||||
>r5 : { x: number; y?: number; } | { x: number; z?: number; }
|
||||
>true ? b : a : { x: number; y?: number; } | { x: number; z?: number; }
|
||||
>true : boolean
|
||||
>b : { x: number; z?: number; }
|
||||
>a : { x: number; y?: number; }
|
||||
|
||||
@@ -29,8 +29,8 @@ var derived2: Derived2;
|
||||
>Derived2 : Derived2
|
||||
|
||||
var r2 = true ? 1 : '';
|
||||
>r2 : number | string
|
||||
>true ? 1 : '' : number | string
|
||||
>r2 : string | number
|
||||
>true ? 1 : '' : string | number
|
||||
>true : boolean
|
||||
>1 : number
|
||||
>'' : string
|
||||
|
||||
@@ -98,8 +98,8 @@ var e3 = t3[2]; // any
|
||||
>2 : number
|
||||
|
||||
var e4 = t4[3]; // number
|
||||
>e4 : E1 | E2 | number
|
||||
>t4[3] : E1 | E2 | number
|
||||
>e4 : number | E1 | E2
|
||||
>t4[3] : number | E1 | E2
|
||||
>t4 : [E1, E2, number]
|
||||
>3 : number
|
||||
|
||||
|
||||
@@ -66,8 +66,8 @@ var t5: [C1, F]
|
||||
>F : F
|
||||
|
||||
var e11 = t1[4]; // base
|
||||
>e11 : C | base
|
||||
>t1[4] : C | base
|
||||
>e11 : base | C
|
||||
>t1[4] : base | C
|
||||
>t1 : [C, base]
|
||||
>4 : number
|
||||
|
||||
@@ -90,8 +90,8 @@ var e41 = t4[2]; // base1
|
||||
>2 : number
|
||||
|
||||
var e51 = t5[2]; // {}
|
||||
>e51 : C1 | F
|
||||
>t5[2] : C1 | F
|
||||
>e51 : F | C1
|
||||
>t5[2] : F | C1
|
||||
>t5 : [C1, F]
|
||||
>2 : number
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -104,7 +104,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break loop;
|
||||
>loop : any
|
||||
@@ -146,7 +146,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
continue loop;
|
||||
>loop : any
|
||||
|
||||
@@ -26,7 +26,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -168,7 +168,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break loop2;
|
||||
>loop2 : any
|
||||
@@ -248,7 +248,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
continue loop2;
|
||||
>loop2 : any
|
||||
|
||||
@@ -28,7 +28,7 @@ function f1() {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return 1;
|
||||
>1 : number
|
||||
|
||||
@@ -25,7 +25,7 @@ for (let x = 1, y = 2; x < y; ++x, --y) {
|
||||
if (x == 1)
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
else
|
||||
|
||||
@@ -29,13 +29,13 @@ function f1() {
|
||||
if (x == 1)
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
else if (y == 2)
|
||||
>y == 2 : boolean
|
||||
>y : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
y = 5;
|
||||
>y = 5 : number
|
||||
@@ -85,13 +85,13 @@ function f2() {
|
||||
if (x == 1)
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
else if (y == 2)
|
||||
>y == 2 : boolean
|
||||
>y : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
y = 5;
|
||||
>y = 5 : number
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
//// [booleanLiteralTypes1.ts]
|
||||
type A1 = true | false;
|
||||
type A2 = false | true;
|
||||
|
||||
function f1() {
|
||||
var a: A1;
|
||||
var a: A2;
|
||||
var a: true | false;
|
||||
var a: false | true;
|
||||
}
|
||||
|
||||
function f2(a: true | false, b: boolean) {
|
||||
a = b;
|
||||
b = a;
|
||||
}
|
||||
|
||||
function f3(a: true | false, b: true | false) {
|
||||
var x = a || b;
|
||||
var x = a && b;
|
||||
var x = !a;
|
||||
}
|
||||
|
||||
function f4(t: true, f: false) {
|
||||
var x1 = t && f;
|
||||
var x2 = f && t;
|
||||
var x3 = t || f;
|
||||
var x4 = f || t;
|
||||
var x5 = !t;
|
||||
var x6 = !f;
|
||||
}
|
||||
|
||||
declare function g(x: true): string;
|
||||
declare function g(x: false): boolean;
|
||||
declare function g(x: boolean): number;
|
||||
|
||||
function f5(b: boolean) {
|
||||
var z1 = g(true);
|
||||
var z2 = g(false);
|
||||
var z3 = g(b);
|
||||
}
|
||||
|
||||
function assertNever(x: never): never {
|
||||
throw new Error("Unexpected value");
|
||||
}
|
||||
|
||||
function f10(x: true | false) {
|
||||
switch (x) {
|
||||
case true: return "true";
|
||||
case false: return "false";
|
||||
}
|
||||
}
|
||||
|
||||
function f11(x: true | false) {
|
||||
switch (x) {
|
||||
case true: return "true";
|
||||
case false: return "false";
|
||||
}
|
||||
return assertNever(x);
|
||||
}
|
||||
|
||||
function f12(x: true | false) {
|
||||
if (x) {
|
||||
x;
|
||||
}
|
||||
else {
|
||||
x;
|
||||
}
|
||||
}
|
||||
|
||||
function f13(x: true | false) {
|
||||
if (x === true) {
|
||||
x;
|
||||
}
|
||||
else {
|
||||
x;
|
||||
}
|
||||
}
|
||||
|
||||
type Item =
|
||||
{ kind: true, a: string } |
|
||||
{ kind: false, b: string };
|
||||
|
||||
function f20(x: Item) {
|
||||
switch (x.kind) {
|
||||
case true: return x.a;
|
||||
case false: return x.b;
|
||||
}
|
||||
}
|
||||
|
||||
function f21(x: Item) {
|
||||
switch (x.kind) {
|
||||
case true: return x.a;
|
||||
case false: return x.b;
|
||||
}
|
||||
return assertNever(x);
|
||||
}
|
||||
|
||||
//// [booleanLiteralTypes1.js]
|
||||
function f1() {
|
||||
var a;
|
||||
var a;
|
||||
var a;
|
||||
var a;
|
||||
}
|
||||
function f2(a, b) {
|
||||
a = b;
|
||||
b = a;
|
||||
}
|
||||
function f3(a, b) {
|
||||
var x = a || b;
|
||||
var x = a && b;
|
||||
var x = !a;
|
||||
}
|
||||
function f4(t, f) {
|
||||
var x1 = t && f;
|
||||
var x2 = f && t;
|
||||
var x3 = t || f;
|
||||
var x4 = f || t;
|
||||
var x5 = !t;
|
||||
var x6 = !f;
|
||||
}
|
||||
function f5(b) {
|
||||
var z1 = g(true);
|
||||
var z2 = g(false);
|
||||
var z3 = g(b);
|
||||
}
|
||||
function assertNever(x) {
|
||||
throw new Error("Unexpected value");
|
||||
}
|
||||
function f10(x) {
|
||||
switch (x) {
|
||||
case true: return "true";
|
||||
case false: return "false";
|
||||
}
|
||||
}
|
||||
function f11(x) {
|
||||
switch (x) {
|
||||
case true: return "true";
|
||||
case false: return "false";
|
||||
}
|
||||
return assertNever(x);
|
||||
}
|
||||
function f12(x) {
|
||||
if (x) {
|
||||
x;
|
||||
}
|
||||
else {
|
||||
x;
|
||||
}
|
||||
}
|
||||
function f13(x) {
|
||||
if (x === true) {
|
||||
x;
|
||||
}
|
||||
else {
|
||||
x;
|
||||
}
|
||||
}
|
||||
function f20(x) {
|
||||
switch (x.kind) {
|
||||
case true: return x.a;
|
||||
case false: return x.b;
|
||||
}
|
||||
}
|
||||
function f21(x) {
|
||||
switch (x.kind) {
|
||||
case true: return x.a;
|
||||
case false: return x.b;
|
||||
}
|
||||
return assertNever(x);
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
=== tests/cases/conformance/types/literal/booleanLiteralTypes1.ts ===
|
||||
type A1 = true | false;
|
||||
>A1 : Symbol(A1, Decl(booleanLiteralTypes1.ts, 0, 0))
|
||||
|
||||
type A2 = false | true;
|
||||
>A2 : Symbol(A2, Decl(booleanLiteralTypes1.ts, 0, 23))
|
||||
|
||||
function f1() {
|
||||
>f1 : Symbol(f1, Decl(booleanLiteralTypes1.ts, 1, 23))
|
||||
|
||||
var a: A1;
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes1.ts, 4, 7), Decl(booleanLiteralTypes1.ts, 5, 7), Decl(booleanLiteralTypes1.ts, 6, 7), Decl(booleanLiteralTypes1.ts, 7, 7))
|
||||
>A1 : Symbol(A1, Decl(booleanLiteralTypes1.ts, 0, 0))
|
||||
|
||||
var a: A2;
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes1.ts, 4, 7), Decl(booleanLiteralTypes1.ts, 5, 7), Decl(booleanLiteralTypes1.ts, 6, 7), Decl(booleanLiteralTypes1.ts, 7, 7))
|
||||
>A2 : Symbol(A2, Decl(booleanLiteralTypes1.ts, 0, 23))
|
||||
|
||||
var a: true | false;
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes1.ts, 4, 7), Decl(booleanLiteralTypes1.ts, 5, 7), Decl(booleanLiteralTypes1.ts, 6, 7), Decl(booleanLiteralTypes1.ts, 7, 7))
|
||||
|
||||
var a: false | true;
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes1.ts, 4, 7), Decl(booleanLiteralTypes1.ts, 5, 7), Decl(booleanLiteralTypes1.ts, 6, 7), Decl(booleanLiteralTypes1.ts, 7, 7))
|
||||
}
|
||||
|
||||
function f2(a: true | false, b: boolean) {
|
||||
>f2 : Symbol(f2, Decl(booleanLiteralTypes1.ts, 8, 1))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes1.ts, 10, 12))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes1.ts, 10, 28))
|
||||
|
||||
a = b;
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes1.ts, 10, 12))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes1.ts, 10, 28))
|
||||
|
||||
b = a;
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes1.ts, 10, 28))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes1.ts, 10, 12))
|
||||
}
|
||||
|
||||
function f3(a: true | false, b: true | false) {
|
||||
>f3 : Symbol(f3, Decl(booleanLiteralTypes1.ts, 13, 1))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes1.ts, 15, 12))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes1.ts, 15, 28))
|
||||
|
||||
var x = a || b;
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 16, 7), Decl(booleanLiteralTypes1.ts, 17, 7), Decl(booleanLiteralTypes1.ts, 18, 7))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes1.ts, 15, 12))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes1.ts, 15, 28))
|
||||
|
||||
var x = a && b;
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 16, 7), Decl(booleanLiteralTypes1.ts, 17, 7), Decl(booleanLiteralTypes1.ts, 18, 7))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes1.ts, 15, 12))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes1.ts, 15, 28))
|
||||
|
||||
var x = !a;
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 16, 7), Decl(booleanLiteralTypes1.ts, 17, 7), Decl(booleanLiteralTypes1.ts, 18, 7))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes1.ts, 15, 12))
|
||||
}
|
||||
|
||||
function f4(t: true, f: false) {
|
||||
>f4 : Symbol(f4, Decl(booleanLiteralTypes1.ts, 19, 1))
|
||||
>t : Symbol(t, Decl(booleanLiteralTypes1.ts, 21, 12))
|
||||
>f : Symbol(f, Decl(booleanLiteralTypes1.ts, 21, 20))
|
||||
|
||||
var x1 = t && f;
|
||||
>x1 : Symbol(x1, Decl(booleanLiteralTypes1.ts, 22, 7))
|
||||
>t : Symbol(t, Decl(booleanLiteralTypes1.ts, 21, 12))
|
||||
>f : Symbol(f, Decl(booleanLiteralTypes1.ts, 21, 20))
|
||||
|
||||
var x2 = f && t;
|
||||
>x2 : Symbol(x2, Decl(booleanLiteralTypes1.ts, 23, 7))
|
||||
>f : Symbol(f, Decl(booleanLiteralTypes1.ts, 21, 20))
|
||||
>t : Symbol(t, Decl(booleanLiteralTypes1.ts, 21, 12))
|
||||
|
||||
var x3 = t || f;
|
||||
>x3 : Symbol(x3, Decl(booleanLiteralTypes1.ts, 24, 7))
|
||||
>t : Symbol(t, Decl(booleanLiteralTypes1.ts, 21, 12))
|
||||
>f : Symbol(f, Decl(booleanLiteralTypes1.ts, 21, 20))
|
||||
|
||||
var x4 = f || t;
|
||||
>x4 : Symbol(x4, Decl(booleanLiteralTypes1.ts, 25, 7))
|
||||
>f : Symbol(f, Decl(booleanLiteralTypes1.ts, 21, 20))
|
||||
>t : Symbol(t, Decl(booleanLiteralTypes1.ts, 21, 12))
|
||||
|
||||
var x5 = !t;
|
||||
>x5 : Symbol(x5, Decl(booleanLiteralTypes1.ts, 26, 7))
|
||||
>t : Symbol(t, Decl(booleanLiteralTypes1.ts, 21, 12))
|
||||
|
||||
var x6 = !f;
|
||||
>x6 : Symbol(x6, Decl(booleanLiteralTypes1.ts, 27, 7))
|
||||
>f : Symbol(f, Decl(booleanLiteralTypes1.ts, 21, 20))
|
||||
}
|
||||
|
||||
declare function g(x: true): string;
|
||||
>g : Symbol(g, Decl(booleanLiteralTypes1.ts, 28, 1), Decl(booleanLiteralTypes1.ts, 30, 36), Decl(booleanLiteralTypes1.ts, 31, 38))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 30, 19))
|
||||
|
||||
declare function g(x: false): boolean;
|
||||
>g : Symbol(g, Decl(booleanLiteralTypes1.ts, 28, 1), Decl(booleanLiteralTypes1.ts, 30, 36), Decl(booleanLiteralTypes1.ts, 31, 38))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 31, 19))
|
||||
|
||||
declare function g(x: boolean): number;
|
||||
>g : Symbol(g, Decl(booleanLiteralTypes1.ts, 28, 1), Decl(booleanLiteralTypes1.ts, 30, 36), Decl(booleanLiteralTypes1.ts, 31, 38))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 32, 19))
|
||||
|
||||
function f5(b: boolean) {
|
||||
>f5 : Symbol(f5, Decl(booleanLiteralTypes1.ts, 32, 39))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes1.ts, 34, 12))
|
||||
|
||||
var z1 = g(true);
|
||||
>z1 : Symbol(z1, Decl(booleanLiteralTypes1.ts, 35, 7))
|
||||
>g : Symbol(g, Decl(booleanLiteralTypes1.ts, 28, 1), Decl(booleanLiteralTypes1.ts, 30, 36), Decl(booleanLiteralTypes1.ts, 31, 38))
|
||||
|
||||
var z2 = g(false);
|
||||
>z2 : Symbol(z2, Decl(booleanLiteralTypes1.ts, 36, 7))
|
||||
>g : Symbol(g, Decl(booleanLiteralTypes1.ts, 28, 1), Decl(booleanLiteralTypes1.ts, 30, 36), Decl(booleanLiteralTypes1.ts, 31, 38))
|
||||
|
||||
var z3 = g(b);
|
||||
>z3 : Symbol(z3, Decl(booleanLiteralTypes1.ts, 37, 7))
|
||||
>g : Symbol(g, Decl(booleanLiteralTypes1.ts, 28, 1), Decl(booleanLiteralTypes1.ts, 30, 36), Decl(booleanLiteralTypes1.ts, 31, 38))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes1.ts, 34, 12))
|
||||
}
|
||||
|
||||
function assertNever(x: never): never {
|
||||
>assertNever : Symbol(assertNever, Decl(booleanLiteralTypes1.ts, 38, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 40, 21))
|
||||
|
||||
throw new Error("Unexpected value");
|
||||
>Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
}
|
||||
|
||||
function f10(x: true | false) {
|
||||
>f10 : Symbol(f10, Decl(booleanLiteralTypes1.ts, 42, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 44, 13))
|
||||
|
||||
switch (x) {
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 44, 13))
|
||||
|
||||
case true: return "true";
|
||||
case false: return "false";
|
||||
}
|
||||
}
|
||||
|
||||
function f11(x: true | false) {
|
||||
>f11 : Symbol(f11, Decl(booleanLiteralTypes1.ts, 49, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 51, 13))
|
||||
|
||||
switch (x) {
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 51, 13))
|
||||
|
||||
case true: return "true";
|
||||
case false: return "false";
|
||||
}
|
||||
return assertNever(x);
|
||||
>assertNever : Symbol(assertNever, Decl(booleanLiteralTypes1.ts, 38, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 51, 13))
|
||||
}
|
||||
|
||||
function f12(x: true | false) {
|
||||
>f12 : Symbol(f12, Decl(booleanLiteralTypes1.ts, 57, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 59, 13))
|
||||
|
||||
if (x) {
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 59, 13))
|
||||
|
||||
x;
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 59, 13))
|
||||
}
|
||||
else {
|
||||
x;
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 59, 13))
|
||||
}
|
||||
}
|
||||
|
||||
function f13(x: true | false) {
|
||||
>f13 : Symbol(f13, Decl(booleanLiteralTypes1.ts, 66, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 68, 13))
|
||||
|
||||
if (x === true) {
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 68, 13))
|
||||
|
||||
x;
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 68, 13))
|
||||
}
|
||||
else {
|
||||
x;
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 68, 13))
|
||||
}
|
||||
}
|
||||
|
||||
type Item =
|
||||
>Item : Symbol(Item, Decl(booleanLiteralTypes1.ts, 75, 1))
|
||||
|
||||
{ kind: true, a: string } |
|
||||
>kind : Symbol(kind, Decl(booleanLiteralTypes1.ts, 78, 5))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes1.ts, 78, 17))
|
||||
|
||||
{ kind: false, b: string };
|
||||
>kind : Symbol(kind, Decl(booleanLiteralTypes1.ts, 79, 5))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes1.ts, 79, 18))
|
||||
|
||||
function f20(x: Item) {
|
||||
>f20 : Symbol(f20, Decl(booleanLiteralTypes1.ts, 79, 31))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 81, 13))
|
||||
>Item : Symbol(Item, Decl(booleanLiteralTypes1.ts, 75, 1))
|
||||
|
||||
switch (x.kind) {
|
||||
>x.kind : Symbol(kind, Decl(booleanLiteralTypes1.ts, 78, 5), Decl(booleanLiteralTypes1.ts, 79, 5))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 81, 13))
|
||||
>kind : Symbol(kind, Decl(booleanLiteralTypes1.ts, 78, 5), Decl(booleanLiteralTypes1.ts, 79, 5))
|
||||
|
||||
case true: return x.a;
|
||||
>x.a : Symbol(a, Decl(booleanLiteralTypes1.ts, 78, 17))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 81, 13))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes1.ts, 78, 17))
|
||||
|
||||
case false: return x.b;
|
||||
>x.b : Symbol(b, Decl(booleanLiteralTypes1.ts, 79, 18))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 81, 13))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes1.ts, 79, 18))
|
||||
}
|
||||
}
|
||||
|
||||
function f21(x: Item) {
|
||||
>f21 : Symbol(f21, Decl(booleanLiteralTypes1.ts, 86, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 88, 13))
|
||||
>Item : Symbol(Item, Decl(booleanLiteralTypes1.ts, 75, 1))
|
||||
|
||||
switch (x.kind) {
|
||||
>x.kind : Symbol(kind, Decl(booleanLiteralTypes1.ts, 78, 5), Decl(booleanLiteralTypes1.ts, 79, 5))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 88, 13))
|
||||
>kind : Symbol(kind, Decl(booleanLiteralTypes1.ts, 78, 5), Decl(booleanLiteralTypes1.ts, 79, 5))
|
||||
|
||||
case true: return x.a;
|
||||
>x.a : Symbol(a, Decl(booleanLiteralTypes1.ts, 78, 17))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 88, 13))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes1.ts, 78, 17))
|
||||
|
||||
case false: return x.b;
|
||||
>x.b : Symbol(b, Decl(booleanLiteralTypes1.ts, 79, 18))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 88, 13))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes1.ts, 79, 18))
|
||||
}
|
||||
return assertNever(x);
|
||||
>assertNever : Symbol(assertNever, Decl(booleanLiteralTypes1.ts, 38, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes1.ts, 88, 13))
|
||||
}
|
||||
@@ -0,0 +1,311 @@
|
||||
=== tests/cases/conformance/types/literal/booleanLiteralTypes1.ts ===
|
||||
type A1 = true | false;
|
||||
>A1 : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
|
||||
type A2 = false | true;
|
||||
>A2 : boolean
|
||||
>false : false
|
||||
>true : true
|
||||
|
||||
function f1() {
|
||||
>f1 : () => void
|
||||
|
||||
var a: A1;
|
||||
>a : boolean
|
||||
>A1 : boolean
|
||||
|
||||
var a: A2;
|
||||
>a : boolean
|
||||
>A2 : boolean
|
||||
|
||||
var a: true | false;
|
||||
>a : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
|
||||
var a: false | true;
|
||||
>a : boolean
|
||||
>false : false
|
||||
>true : true
|
||||
}
|
||||
|
||||
function f2(a: true | false, b: boolean) {
|
||||
>f2 : (a: boolean, b: boolean) => void
|
||||
>a : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
>b : boolean
|
||||
|
||||
a = b;
|
||||
>a = b : boolean
|
||||
>a : boolean
|
||||
>b : boolean
|
||||
|
||||
b = a;
|
||||
>b = a : boolean
|
||||
>b : boolean
|
||||
>a : boolean
|
||||
}
|
||||
|
||||
function f3(a: true | false, b: true | false) {
|
||||
>f3 : (a: boolean, b: boolean) => void
|
||||
>a : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
>b : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
|
||||
var x = a || b;
|
||||
>x : boolean
|
||||
>a || b : boolean
|
||||
>a : boolean
|
||||
>b : boolean
|
||||
|
||||
var x = a && b;
|
||||
>x : boolean
|
||||
>a && b : boolean
|
||||
>a : boolean
|
||||
>b : boolean
|
||||
|
||||
var x = !a;
|
||||
>x : boolean
|
||||
>!a : boolean
|
||||
>a : boolean
|
||||
}
|
||||
|
||||
function f4(t: true, f: false) {
|
||||
>f4 : (t: true, f: false) => void
|
||||
>t : true
|
||||
>true : true
|
||||
>f : false
|
||||
>false : false
|
||||
|
||||
var x1 = t && f;
|
||||
>x1 : false
|
||||
>t && f : false
|
||||
>t : true
|
||||
>f : false
|
||||
|
||||
var x2 = f && t;
|
||||
>x2 : false
|
||||
>f && t : false
|
||||
>f : false
|
||||
>t : true
|
||||
|
||||
var x3 = t || f;
|
||||
>x3 : boolean
|
||||
>t || f : boolean
|
||||
>t : true
|
||||
>f : false
|
||||
|
||||
var x4 = f || t;
|
||||
>x4 : true
|
||||
>f || t : true
|
||||
>f : false
|
||||
>t : true
|
||||
|
||||
var x5 = !t;
|
||||
>x5 : boolean
|
||||
>!t : boolean
|
||||
>t : true
|
||||
|
||||
var x6 = !f;
|
||||
>x6 : true
|
||||
>!f : true
|
||||
>f : false
|
||||
}
|
||||
|
||||
declare function g(x: true): string;
|
||||
>g : { (x: true): string; (x: false): boolean; (x: boolean): number; }
|
||||
>x : true
|
||||
>true : true
|
||||
|
||||
declare function g(x: false): boolean;
|
||||
>g : { (x: true): string; (x: false): boolean; (x: boolean): number; }
|
||||
>x : false
|
||||
>false : false
|
||||
|
||||
declare function g(x: boolean): number;
|
||||
>g : { (x: true): string; (x: false): boolean; (x: boolean): number; }
|
||||
>x : boolean
|
||||
|
||||
function f5(b: boolean) {
|
||||
>f5 : (b: boolean) => void
|
||||
>b : boolean
|
||||
|
||||
var z1 = g(true);
|
||||
>z1 : string
|
||||
>g(true) : string
|
||||
>g : { (x: true): string; (x: false): boolean; (x: boolean): number; }
|
||||
>true : true
|
||||
|
||||
var z2 = g(false);
|
||||
>z2 : boolean
|
||||
>g(false) : boolean
|
||||
>g : { (x: true): string; (x: false): boolean; (x: boolean): number; }
|
||||
>false : false
|
||||
|
||||
var z3 = g(b);
|
||||
>z3 : number
|
||||
>g(b) : number
|
||||
>g : { (x: true): string; (x: false): boolean; (x: boolean): number; }
|
||||
>b : boolean
|
||||
}
|
||||
|
||||
function assertNever(x: never): never {
|
||||
>assertNever : (x: never) => never
|
||||
>x : never
|
||||
|
||||
throw new Error("Unexpected value");
|
||||
>new Error("Unexpected value") : Error
|
||||
>Error : ErrorConstructor
|
||||
>"Unexpected value" : string
|
||||
}
|
||||
|
||||
function f10(x: true | false) {
|
||||
>f10 : (x: boolean) => string
|
||||
>x : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
|
||||
switch (x) {
|
||||
>x : boolean
|
||||
|
||||
case true: return "true";
|
||||
>true : true
|
||||
>"true" : string
|
||||
|
||||
case false: return "false";
|
||||
>false : false
|
||||
>"false" : string
|
||||
}
|
||||
}
|
||||
|
||||
function f11(x: true | false) {
|
||||
>f11 : (x: boolean) => string
|
||||
>x : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
|
||||
switch (x) {
|
||||
>x : boolean
|
||||
|
||||
case true: return "true";
|
||||
>true : true
|
||||
>"true" : string
|
||||
|
||||
case false: return "false";
|
||||
>false : false
|
||||
>"false" : string
|
||||
}
|
||||
return assertNever(x);
|
||||
>assertNever(x) : never
|
||||
>assertNever : (x: never) => never
|
||||
>x : never
|
||||
}
|
||||
|
||||
function f12(x: true | false) {
|
||||
>f12 : (x: boolean) => void
|
||||
>x : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
|
||||
if (x) {
|
||||
>x : boolean
|
||||
|
||||
x;
|
||||
>x : true
|
||||
}
|
||||
else {
|
||||
x;
|
||||
>x : boolean
|
||||
}
|
||||
}
|
||||
|
||||
function f13(x: true | false) {
|
||||
>f13 : (x: boolean) => void
|
||||
>x : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
|
||||
if (x === true) {
|
||||
>x === true : boolean
|
||||
>x : boolean
|
||||
>true : true
|
||||
|
||||
x;
|
||||
>x : true
|
||||
}
|
||||
else {
|
||||
x;
|
||||
>x : false
|
||||
}
|
||||
}
|
||||
|
||||
type Item =
|
||||
>Item : Item
|
||||
|
||||
{ kind: true, a: string } |
|
||||
>kind : true
|
||||
>true : true
|
||||
>a : string
|
||||
|
||||
{ kind: false, b: string };
|
||||
>kind : false
|
||||
>false : false
|
||||
>b : string
|
||||
|
||||
function f20(x: Item) {
|
||||
>f20 : (x: Item) => string
|
||||
>x : Item
|
||||
>Item : Item
|
||||
|
||||
switch (x.kind) {
|
||||
>x.kind : boolean
|
||||
>x : Item
|
||||
>kind : boolean
|
||||
|
||||
case true: return x.a;
|
||||
>true : true
|
||||
>x.a : string
|
||||
>x : { kind: true; a: string; }
|
||||
>a : string
|
||||
|
||||
case false: return x.b;
|
||||
>false : false
|
||||
>x.b : string
|
||||
>x : { kind: false; b: string; }
|
||||
>b : string
|
||||
}
|
||||
}
|
||||
|
||||
function f21(x: Item) {
|
||||
>f21 : (x: Item) => string
|
||||
>x : Item
|
||||
>Item : Item
|
||||
|
||||
switch (x.kind) {
|
||||
>x.kind : boolean
|
||||
>x : Item
|
||||
>kind : boolean
|
||||
|
||||
case true: return x.a;
|
||||
>true : true
|
||||
>x.a : string
|
||||
>x : { kind: true; a: string; }
|
||||
>a : string
|
||||
|
||||
case false: return x.b;
|
||||
>false : false
|
||||
>x.b : string
|
||||
>x : { kind: false; b: string; }
|
||||
>b : string
|
||||
}
|
||||
return assertNever(x);
|
||||
>assertNever(x) : never
|
||||
>assertNever : (x: never) => never
|
||||
>x : never
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
//// [booleanLiteralTypes2.ts]
|
||||
|
||||
type A1 = true | false;
|
||||
type A2 = false | true;
|
||||
|
||||
function f1() {
|
||||
var a: A1;
|
||||
var a: A2;
|
||||
var a: true | false;
|
||||
var a: false | true;
|
||||
}
|
||||
|
||||
function f2(a: true | false, b: boolean) {
|
||||
a = b;
|
||||
b = a;
|
||||
}
|
||||
|
||||
function f3(a: true | false, b: true | false) {
|
||||
var x = a || b;
|
||||
var x = a && b;
|
||||
var x = !a;
|
||||
}
|
||||
|
||||
function f4(t: true, f: false) {
|
||||
var x1 = t && f;
|
||||
var x2 = f && t;
|
||||
var x3 = t || f;
|
||||
var x4 = f || t;
|
||||
var x5 = !t;
|
||||
var x6 = !f;
|
||||
}
|
||||
|
||||
declare function g(x: true): string;
|
||||
declare function g(x: false): boolean;
|
||||
declare function g(x: boolean): number;
|
||||
|
||||
function f5(b: boolean) {
|
||||
var z1 = g(true);
|
||||
var z2 = g(false);
|
||||
var z3 = g(b);
|
||||
}
|
||||
|
||||
function assertNever(x: never): never {
|
||||
throw new Error("Unexpected value");
|
||||
}
|
||||
|
||||
function f10(x: true | false) {
|
||||
switch (x) {
|
||||
case true: return "true";
|
||||
case false: return "false";
|
||||
}
|
||||
}
|
||||
|
||||
function f11(x: true | false) {
|
||||
switch (x) {
|
||||
case true: return "true";
|
||||
case false: return "false";
|
||||
}
|
||||
return assertNever(x);
|
||||
}
|
||||
|
||||
function f12(x: true | false) {
|
||||
if (x) {
|
||||
x;
|
||||
}
|
||||
else {
|
||||
x;
|
||||
}
|
||||
}
|
||||
|
||||
function f13(x: true | false) {
|
||||
if (x === true) {
|
||||
x;
|
||||
}
|
||||
else {
|
||||
x;
|
||||
}
|
||||
}
|
||||
|
||||
type Item =
|
||||
{ kind: true, a: string } |
|
||||
{ kind: false, b: string };
|
||||
|
||||
function f20(x: Item) {
|
||||
switch (x.kind) {
|
||||
case true: return x.a;
|
||||
case false: return x.b;
|
||||
}
|
||||
}
|
||||
|
||||
function f21(x: Item) {
|
||||
switch (x.kind) {
|
||||
case true: return x.a;
|
||||
case false: return x.b;
|
||||
}
|
||||
return assertNever(x);
|
||||
}
|
||||
|
||||
//// [booleanLiteralTypes2.js]
|
||||
function f1() {
|
||||
var a;
|
||||
var a;
|
||||
var a;
|
||||
var a;
|
||||
}
|
||||
function f2(a, b) {
|
||||
a = b;
|
||||
b = a;
|
||||
}
|
||||
function f3(a, b) {
|
||||
var x = a || b;
|
||||
var x = a && b;
|
||||
var x = !a;
|
||||
}
|
||||
function f4(t, f) {
|
||||
var x1 = t && f;
|
||||
var x2 = f && t;
|
||||
var x3 = t || f;
|
||||
var x4 = f || t;
|
||||
var x5 = !t;
|
||||
var x6 = !f;
|
||||
}
|
||||
function f5(b) {
|
||||
var z1 = g(true);
|
||||
var z2 = g(false);
|
||||
var z3 = g(b);
|
||||
}
|
||||
function assertNever(x) {
|
||||
throw new Error("Unexpected value");
|
||||
}
|
||||
function f10(x) {
|
||||
switch (x) {
|
||||
case true: return "true";
|
||||
case false: return "false";
|
||||
}
|
||||
}
|
||||
function f11(x) {
|
||||
switch (x) {
|
||||
case true: return "true";
|
||||
case false: return "false";
|
||||
}
|
||||
return assertNever(x);
|
||||
}
|
||||
function f12(x) {
|
||||
if (x) {
|
||||
x;
|
||||
}
|
||||
else {
|
||||
x;
|
||||
}
|
||||
}
|
||||
function f13(x) {
|
||||
if (x === true) {
|
||||
x;
|
||||
}
|
||||
else {
|
||||
x;
|
||||
}
|
||||
}
|
||||
function f20(x) {
|
||||
switch (x.kind) {
|
||||
case true: return x.a;
|
||||
case false: return x.b;
|
||||
}
|
||||
}
|
||||
function f21(x) {
|
||||
switch (x.kind) {
|
||||
case true: return x.a;
|
||||
case false: return x.b;
|
||||
}
|
||||
return assertNever(x);
|
||||
}
|
||||
@@ -0,0 +1,248 @@
|
||||
=== tests/cases/conformance/types/literal/booleanLiteralTypes2.ts ===
|
||||
|
||||
type A1 = true | false;
|
||||
>A1 : Symbol(A1, Decl(booleanLiteralTypes2.ts, 0, 0))
|
||||
|
||||
type A2 = false | true;
|
||||
>A2 : Symbol(A2, Decl(booleanLiteralTypes2.ts, 1, 23))
|
||||
|
||||
function f1() {
|
||||
>f1 : Symbol(f1, Decl(booleanLiteralTypes2.ts, 2, 23))
|
||||
|
||||
var a: A1;
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes2.ts, 5, 7), Decl(booleanLiteralTypes2.ts, 6, 7), Decl(booleanLiteralTypes2.ts, 7, 7), Decl(booleanLiteralTypes2.ts, 8, 7))
|
||||
>A1 : Symbol(A1, Decl(booleanLiteralTypes2.ts, 0, 0))
|
||||
|
||||
var a: A2;
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes2.ts, 5, 7), Decl(booleanLiteralTypes2.ts, 6, 7), Decl(booleanLiteralTypes2.ts, 7, 7), Decl(booleanLiteralTypes2.ts, 8, 7))
|
||||
>A2 : Symbol(A2, Decl(booleanLiteralTypes2.ts, 1, 23))
|
||||
|
||||
var a: true | false;
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes2.ts, 5, 7), Decl(booleanLiteralTypes2.ts, 6, 7), Decl(booleanLiteralTypes2.ts, 7, 7), Decl(booleanLiteralTypes2.ts, 8, 7))
|
||||
|
||||
var a: false | true;
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes2.ts, 5, 7), Decl(booleanLiteralTypes2.ts, 6, 7), Decl(booleanLiteralTypes2.ts, 7, 7), Decl(booleanLiteralTypes2.ts, 8, 7))
|
||||
}
|
||||
|
||||
function f2(a: true | false, b: boolean) {
|
||||
>f2 : Symbol(f2, Decl(booleanLiteralTypes2.ts, 9, 1))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes2.ts, 11, 12))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes2.ts, 11, 28))
|
||||
|
||||
a = b;
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes2.ts, 11, 12))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes2.ts, 11, 28))
|
||||
|
||||
b = a;
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes2.ts, 11, 28))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes2.ts, 11, 12))
|
||||
}
|
||||
|
||||
function f3(a: true | false, b: true | false) {
|
||||
>f3 : Symbol(f3, Decl(booleanLiteralTypes2.ts, 14, 1))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes2.ts, 16, 12))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes2.ts, 16, 28))
|
||||
|
||||
var x = a || b;
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 17, 7), Decl(booleanLiteralTypes2.ts, 18, 7), Decl(booleanLiteralTypes2.ts, 19, 7))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes2.ts, 16, 12))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes2.ts, 16, 28))
|
||||
|
||||
var x = a && b;
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 17, 7), Decl(booleanLiteralTypes2.ts, 18, 7), Decl(booleanLiteralTypes2.ts, 19, 7))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes2.ts, 16, 12))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes2.ts, 16, 28))
|
||||
|
||||
var x = !a;
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 17, 7), Decl(booleanLiteralTypes2.ts, 18, 7), Decl(booleanLiteralTypes2.ts, 19, 7))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes2.ts, 16, 12))
|
||||
}
|
||||
|
||||
function f4(t: true, f: false) {
|
||||
>f4 : Symbol(f4, Decl(booleanLiteralTypes2.ts, 20, 1))
|
||||
>t : Symbol(t, Decl(booleanLiteralTypes2.ts, 22, 12))
|
||||
>f : Symbol(f, Decl(booleanLiteralTypes2.ts, 22, 20))
|
||||
|
||||
var x1 = t && f;
|
||||
>x1 : Symbol(x1, Decl(booleanLiteralTypes2.ts, 23, 7))
|
||||
>t : Symbol(t, Decl(booleanLiteralTypes2.ts, 22, 12))
|
||||
>f : Symbol(f, Decl(booleanLiteralTypes2.ts, 22, 20))
|
||||
|
||||
var x2 = f && t;
|
||||
>x2 : Symbol(x2, Decl(booleanLiteralTypes2.ts, 24, 7))
|
||||
>f : Symbol(f, Decl(booleanLiteralTypes2.ts, 22, 20))
|
||||
>t : Symbol(t, Decl(booleanLiteralTypes2.ts, 22, 12))
|
||||
|
||||
var x3 = t || f;
|
||||
>x3 : Symbol(x3, Decl(booleanLiteralTypes2.ts, 25, 7))
|
||||
>t : Symbol(t, Decl(booleanLiteralTypes2.ts, 22, 12))
|
||||
>f : Symbol(f, Decl(booleanLiteralTypes2.ts, 22, 20))
|
||||
|
||||
var x4 = f || t;
|
||||
>x4 : Symbol(x4, Decl(booleanLiteralTypes2.ts, 26, 7))
|
||||
>f : Symbol(f, Decl(booleanLiteralTypes2.ts, 22, 20))
|
||||
>t : Symbol(t, Decl(booleanLiteralTypes2.ts, 22, 12))
|
||||
|
||||
var x5 = !t;
|
||||
>x5 : Symbol(x5, Decl(booleanLiteralTypes2.ts, 27, 7))
|
||||
>t : Symbol(t, Decl(booleanLiteralTypes2.ts, 22, 12))
|
||||
|
||||
var x6 = !f;
|
||||
>x6 : Symbol(x6, Decl(booleanLiteralTypes2.ts, 28, 7))
|
||||
>f : Symbol(f, Decl(booleanLiteralTypes2.ts, 22, 20))
|
||||
}
|
||||
|
||||
declare function g(x: true): string;
|
||||
>g : Symbol(g, Decl(booleanLiteralTypes2.ts, 29, 1), Decl(booleanLiteralTypes2.ts, 31, 36), Decl(booleanLiteralTypes2.ts, 32, 38))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 31, 19))
|
||||
|
||||
declare function g(x: false): boolean;
|
||||
>g : Symbol(g, Decl(booleanLiteralTypes2.ts, 29, 1), Decl(booleanLiteralTypes2.ts, 31, 36), Decl(booleanLiteralTypes2.ts, 32, 38))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 32, 19))
|
||||
|
||||
declare function g(x: boolean): number;
|
||||
>g : Symbol(g, Decl(booleanLiteralTypes2.ts, 29, 1), Decl(booleanLiteralTypes2.ts, 31, 36), Decl(booleanLiteralTypes2.ts, 32, 38))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 33, 19))
|
||||
|
||||
function f5(b: boolean) {
|
||||
>f5 : Symbol(f5, Decl(booleanLiteralTypes2.ts, 33, 39))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes2.ts, 35, 12))
|
||||
|
||||
var z1 = g(true);
|
||||
>z1 : Symbol(z1, Decl(booleanLiteralTypes2.ts, 36, 7))
|
||||
>g : Symbol(g, Decl(booleanLiteralTypes2.ts, 29, 1), Decl(booleanLiteralTypes2.ts, 31, 36), Decl(booleanLiteralTypes2.ts, 32, 38))
|
||||
|
||||
var z2 = g(false);
|
||||
>z2 : Symbol(z2, Decl(booleanLiteralTypes2.ts, 37, 7))
|
||||
>g : Symbol(g, Decl(booleanLiteralTypes2.ts, 29, 1), Decl(booleanLiteralTypes2.ts, 31, 36), Decl(booleanLiteralTypes2.ts, 32, 38))
|
||||
|
||||
var z3 = g(b);
|
||||
>z3 : Symbol(z3, Decl(booleanLiteralTypes2.ts, 38, 7))
|
||||
>g : Symbol(g, Decl(booleanLiteralTypes2.ts, 29, 1), Decl(booleanLiteralTypes2.ts, 31, 36), Decl(booleanLiteralTypes2.ts, 32, 38))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes2.ts, 35, 12))
|
||||
}
|
||||
|
||||
function assertNever(x: never): never {
|
||||
>assertNever : Symbol(assertNever, Decl(booleanLiteralTypes2.ts, 39, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 41, 21))
|
||||
|
||||
throw new Error("Unexpected value");
|
||||
>Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
}
|
||||
|
||||
function f10(x: true | false) {
|
||||
>f10 : Symbol(f10, Decl(booleanLiteralTypes2.ts, 43, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 45, 13))
|
||||
|
||||
switch (x) {
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 45, 13))
|
||||
|
||||
case true: return "true";
|
||||
case false: return "false";
|
||||
}
|
||||
}
|
||||
|
||||
function f11(x: true | false) {
|
||||
>f11 : Symbol(f11, Decl(booleanLiteralTypes2.ts, 50, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 52, 13))
|
||||
|
||||
switch (x) {
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 52, 13))
|
||||
|
||||
case true: return "true";
|
||||
case false: return "false";
|
||||
}
|
||||
return assertNever(x);
|
||||
>assertNever : Symbol(assertNever, Decl(booleanLiteralTypes2.ts, 39, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 52, 13))
|
||||
}
|
||||
|
||||
function f12(x: true | false) {
|
||||
>f12 : Symbol(f12, Decl(booleanLiteralTypes2.ts, 58, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 60, 13))
|
||||
|
||||
if (x) {
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 60, 13))
|
||||
|
||||
x;
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 60, 13))
|
||||
}
|
||||
else {
|
||||
x;
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 60, 13))
|
||||
}
|
||||
}
|
||||
|
||||
function f13(x: true | false) {
|
||||
>f13 : Symbol(f13, Decl(booleanLiteralTypes2.ts, 67, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 69, 13))
|
||||
|
||||
if (x === true) {
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 69, 13))
|
||||
|
||||
x;
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 69, 13))
|
||||
}
|
||||
else {
|
||||
x;
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 69, 13))
|
||||
}
|
||||
}
|
||||
|
||||
type Item =
|
||||
>Item : Symbol(Item, Decl(booleanLiteralTypes2.ts, 76, 1))
|
||||
|
||||
{ kind: true, a: string } |
|
||||
>kind : Symbol(kind, Decl(booleanLiteralTypes2.ts, 79, 5))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes2.ts, 79, 17))
|
||||
|
||||
{ kind: false, b: string };
|
||||
>kind : Symbol(kind, Decl(booleanLiteralTypes2.ts, 80, 5))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes2.ts, 80, 18))
|
||||
|
||||
function f20(x: Item) {
|
||||
>f20 : Symbol(f20, Decl(booleanLiteralTypes2.ts, 80, 31))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 82, 13))
|
||||
>Item : Symbol(Item, Decl(booleanLiteralTypes2.ts, 76, 1))
|
||||
|
||||
switch (x.kind) {
|
||||
>x.kind : Symbol(kind, Decl(booleanLiteralTypes2.ts, 79, 5), Decl(booleanLiteralTypes2.ts, 80, 5))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 82, 13))
|
||||
>kind : Symbol(kind, Decl(booleanLiteralTypes2.ts, 79, 5), Decl(booleanLiteralTypes2.ts, 80, 5))
|
||||
|
||||
case true: return x.a;
|
||||
>x.a : Symbol(a, Decl(booleanLiteralTypes2.ts, 79, 17))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 82, 13))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes2.ts, 79, 17))
|
||||
|
||||
case false: return x.b;
|
||||
>x.b : Symbol(b, Decl(booleanLiteralTypes2.ts, 80, 18))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 82, 13))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes2.ts, 80, 18))
|
||||
}
|
||||
}
|
||||
|
||||
function f21(x: Item) {
|
||||
>f21 : Symbol(f21, Decl(booleanLiteralTypes2.ts, 87, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 89, 13))
|
||||
>Item : Symbol(Item, Decl(booleanLiteralTypes2.ts, 76, 1))
|
||||
|
||||
switch (x.kind) {
|
||||
>x.kind : Symbol(kind, Decl(booleanLiteralTypes2.ts, 79, 5), Decl(booleanLiteralTypes2.ts, 80, 5))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 89, 13))
|
||||
>kind : Symbol(kind, Decl(booleanLiteralTypes2.ts, 79, 5), Decl(booleanLiteralTypes2.ts, 80, 5))
|
||||
|
||||
case true: return x.a;
|
||||
>x.a : Symbol(a, Decl(booleanLiteralTypes2.ts, 79, 17))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 89, 13))
|
||||
>a : Symbol(a, Decl(booleanLiteralTypes2.ts, 79, 17))
|
||||
|
||||
case false: return x.b;
|
||||
>x.b : Symbol(b, Decl(booleanLiteralTypes2.ts, 80, 18))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 89, 13))
|
||||
>b : Symbol(b, Decl(booleanLiteralTypes2.ts, 80, 18))
|
||||
}
|
||||
return assertNever(x);
|
||||
>assertNever : Symbol(assertNever, Decl(booleanLiteralTypes2.ts, 39, 1))
|
||||
>x : Symbol(x, Decl(booleanLiteralTypes2.ts, 89, 13))
|
||||
}
|
||||
@@ -0,0 +1,312 @@
|
||||
=== tests/cases/conformance/types/literal/booleanLiteralTypes2.ts ===
|
||||
|
||||
type A1 = true | false;
|
||||
>A1 : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
|
||||
type A2 = false | true;
|
||||
>A2 : boolean
|
||||
>false : false
|
||||
>true : true
|
||||
|
||||
function f1() {
|
||||
>f1 : () => void
|
||||
|
||||
var a: A1;
|
||||
>a : boolean
|
||||
>A1 : boolean
|
||||
|
||||
var a: A2;
|
||||
>a : boolean
|
||||
>A2 : boolean
|
||||
|
||||
var a: true | false;
|
||||
>a : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
|
||||
var a: false | true;
|
||||
>a : boolean
|
||||
>false : false
|
||||
>true : true
|
||||
}
|
||||
|
||||
function f2(a: true | false, b: boolean) {
|
||||
>f2 : (a: boolean, b: boolean) => void
|
||||
>a : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
>b : boolean
|
||||
|
||||
a = b;
|
||||
>a = b : boolean
|
||||
>a : boolean
|
||||
>b : boolean
|
||||
|
||||
b = a;
|
||||
>b = a : boolean
|
||||
>b : boolean
|
||||
>a : boolean
|
||||
}
|
||||
|
||||
function f3(a: true | false, b: true | false) {
|
||||
>f3 : (a: boolean, b: boolean) => void
|
||||
>a : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
>b : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
|
||||
var x = a || b;
|
||||
>x : boolean
|
||||
>a || b : boolean
|
||||
>a : boolean
|
||||
>b : boolean
|
||||
|
||||
var x = a && b;
|
||||
>x : boolean
|
||||
>a && b : boolean
|
||||
>a : boolean
|
||||
>b : boolean
|
||||
|
||||
var x = !a;
|
||||
>x : boolean
|
||||
>!a : boolean
|
||||
>a : boolean
|
||||
}
|
||||
|
||||
function f4(t: true, f: false) {
|
||||
>f4 : (t: true, f: false) => void
|
||||
>t : true
|
||||
>true : true
|
||||
>f : false
|
||||
>false : false
|
||||
|
||||
var x1 = t && f;
|
||||
>x1 : false
|
||||
>t && f : false
|
||||
>t : true
|
||||
>f : false
|
||||
|
||||
var x2 = f && t;
|
||||
>x2 : false
|
||||
>f && t : false
|
||||
>f : false
|
||||
>t : true
|
||||
|
||||
var x3 = t || f;
|
||||
>x3 : true
|
||||
>t || f : true
|
||||
>t : true
|
||||
>f : false
|
||||
|
||||
var x4 = f || t;
|
||||
>x4 : true
|
||||
>f || t : true
|
||||
>f : false
|
||||
>t : true
|
||||
|
||||
var x5 = !t;
|
||||
>x5 : false
|
||||
>!t : false
|
||||
>t : true
|
||||
|
||||
var x6 = !f;
|
||||
>x6 : true
|
||||
>!f : true
|
||||
>f : false
|
||||
}
|
||||
|
||||
declare function g(x: true): string;
|
||||
>g : { (x: true): string; (x: false): boolean; (x: boolean): number; }
|
||||
>x : true
|
||||
>true : true
|
||||
|
||||
declare function g(x: false): boolean;
|
||||
>g : { (x: true): string; (x: false): boolean; (x: boolean): number; }
|
||||
>x : false
|
||||
>false : false
|
||||
|
||||
declare function g(x: boolean): number;
|
||||
>g : { (x: true): string; (x: false): boolean; (x: boolean): number; }
|
||||
>x : boolean
|
||||
|
||||
function f5(b: boolean) {
|
||||
>f5 : (b: boolean) => void
|
||||
>b : boolean
|
||||
|
||||
var z1 = g(true);
|
||||
>z1 : string
|
||||
>g(true) : string
|
||||
>g : { (x: true): string; (x: false): boolean; (x: boolean): number; }
|
||||
>true : true
|
||||
|
||||
var z2 = g(false);
|
||||
>z2 : boolean
|
||||
>g(false) : boolean
|
||||
>g : { (x: true): string; (x: false): boolean; (x: boolean): number; }
|
||||
>false : false
|
||||
|
||||
var z3 = g(b);
|
||||
>z3 : number
|
||||
>g(b) : number
|
||||
>g : { (x: true): string; (x: false): boolean; (x: boolean): number; }
|
||||
>b : boolean
|
||||
}
|
||||
|
||||
function assertNever(x: never): never {
|
||||
>assertNever : (x: never) => never
|
||||
>x : never
|
||||
|
||||
throw new Error("Unexpected value");
|
||||
>new Error("Unexpected value") : Error
|
||||
>Error : ErrorConstructor
|
||||
>"Unexpected value" : string
|
||||
}
|
||||
|
||||
function f10(x: true | false) {
|
||||
>f10 : (x: boolean) => string
|
||||
>x : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
|
||||
switch (x) {
|
||||
>x : boolean
|
||||
|
||||
case true: return "true";
|
||||
>true : true
|
||||
>"true" : string
|
||||
|
||||
case false: return "false";
|
||||
>false : false
|
||||
>"false" : string
|
||||
}
|
||||
}
|
||||
|
||||
function f11(x: true | false) {
|
||||
>f11 : (x: boolean) => string
|
||||
>x : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
|
||||
switch (x) {
|
||||
>x : boolean
|
||||
|
||||
case true: return "true";
|
||||
>true : true
|
||||
>"true" : string
|
||||
|
||||
case false: return "false";
|
||||
>false : false
|
||||
>"false" : string
|
||||
}
|
||||
return assertNever(x);
|
||||
>assertNever(x) : never
|
||||
>assertNever : (x: never) => never
|
||||
>x : never
|
||||
}
|
||||
|
||||
function f12(x: true | false) {
|
||||
>f12 : (x: boolean) => void
|
||||
>x : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
|
||||
if (x) {
|
||||
>x : boolean
|
||||
|
||||
x;
|
||||
>x : true
|
||||
}
|
||||
else {
|
||||
x;
|
||||
>x : false
|
||||
}
|
||||
}
|
||||
|
||||
function f13(x: true | false) {
|
||||
>f13 : (x: boolean) => void
|
||||
>x : boolean
|
||||
>true : true
|
||||
>false : false
|
||||
|
||||
if (x === true) {
|
||||
>x === true : boolean
|
||||
>x : boolean
|
||||
>true : true
|
||||
|
||||
x;
|
||||
>x : true
|
||||
}
|
||||
else {
|
||||
x;
|
||||
>x : false
|
||||
}
|
||||
}
|
||||
|
||||
type Item =
|
||||
>Item : Item
|
||||
|
||||
{ kind: true, a: string } |
|
||||
>kind : true
|
||||
>true : true
|
||||
>a : string
|
||||
|
||||
{ kind: false, b: string };
|
||||
>kind : false
|
||||
>false : false
|
||||
>b : string
|
||||
|
||||
function f20(x: Item) {
|
||||
>f20 : (x: Item) => string
|
||||
>x : Item
|
||||
>Item : Item
|
||||
|
||||
switch (x.kind) {
|
||||
>x.kind : boolean
|
||||
>x : Item
|
||||
>kind : boolean
|
||||
|
||||
case true: return x.a;
|
||||
>true : true
|
||||
>x.a : string
|
||||
>x : { kind: true; a: string; }
|
||||
>a : string
|
||||
|
||||
case false: return x.b;
|
||||
>false : false
|
||||
>x.b : string
|
||||
>x : { kind: false; b: string; }
|
||||
>b : string
|
||||
}
|
||||
}
|
||||
|
||||
function f21(x: Item) {
|
||||
>f21 : (x: Item) => string
|
||||
>x : Item
|
||||
>Item : Item
|
||||
|
||||
switch (x.kind) {
|
||||
>x.kind : boolean
|
||||
>x : Item
|
||||
>kind : boolean
|
||||
|
||||
case true: return x.a;
|
||||
>true : true
|
||||
>x.a : string
|
||||
>x : { kind: true; a: string; }
|
||||
>a : string
|
||||
|
||||
case false: return x.b;
|
||||
>false : false
|
||||
>x.b : string
|
||||
>x : { kind: false; b: string; }
|
||||
>b : string
|
||||
}
|
||||
return assertNever(x);
|
||||
>assertNever(x) : never
|
||||
>assertNever : (x: never) => never
|
||||
>x : never
|
||||
}
|
||||
+3
-3
@@ -15,8 +15,8 @@ var i: I<string>;
|
||||
>I : I<T>
|
||||
|
||||
var y = i(""); // y should be string
|
||||
>y : string
|
||||
>i("") : string
|
||||
>y : ""
|
||||
>i("") : ""
|
||||
>i : I<string>
|
||||
>"" : string
|
||||
>"" : ""
|
||||
|
||||
|
||||
@@ -163,8 +163,8 @@ xa[1].foo(1, 2, ...a, "abc");
|
||||
>xa : X[]
|
||||
>1 : number
|
||||
>foo : (x: number, y: number, ...z: string[]) => any
|
||||
>...[1, 2, "abc"] : number | string
|
||||
>[1, 2, "abc"] : (number | string)[]
|
||||
>...[1, 2, "abc"] : string | number
|
||||
>[1, 2, "abc"] : (string | number)[]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"abc" : string
|
||||
|
||||
@@ -164,8 +164,8 @@ xa[1].foo(1, 2, ...a, "abc");
|
||||
>xa : X[]
|
||||
>1 : number
|
||||
>foo : (x: number, y: number, ...z: string[]) => any
|
||||
>...[1, 2, "abc"] : number | string
|
||||
>[1, 2, "abc"] : (number | string)[]
|
||||
>...[1, 2, "abc"] : string | number
|
||||
>[1, 2, "abc"] : (string | number)[]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"abc" : string
|
||||
|
||||
@@ -52,8 +52,8 @@ for (let x = 0; x < 1; ++x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x;
|
||||
>x : any
|
||||
@@ -85,8 +85,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (let y = 0; y < 1; ++y) {
|
||||
>y : number
|
||||
@@ -140,8 +140,8 @@ for (let x = 0, y = 1; x < 1; ++x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x, y;
|
||||
>x : any
|
||||
@@ -183,8 +183,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (let y = 0; y < 1; ++y) {
|
||||
>y : number
|
||||
@@ -265,8 +265,8 @@ for (const x = 0; x < 1;) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1;
|
||||
>x : number
|
||||
@@ -300,8 +300,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (const y = 0; y < 1;) {
|
||||
>y : number
|
||||
@@ -351,8 +351,8 @@ for (const x = 0, y = 1; x < 1;) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1, y = 1;
|
||||
>x : number
|
||||
@@ -398,8 +398,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (const y = 0; y < 1;) {
|
||||
>y : number
|
||||
|
||||
@@ -21,7 +21,7 @@ function foo() {
|
||||
>a : number
|
||||
|
||||
case 0: return () => a;
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>() => a : () => number
|
||||
>a : number
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ function foo() {
|
||||
>a : number
|
||||
|
||||
case 0: return () => a;
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>() => a : () => number
|
||||
>a : number
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ for (let x = 0; x < 1; ++x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x;
|
||||
>x : any
|
||||
@@ -85,8 +85,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (let y = 0; y < 1; ++y) {
|
||||
>y : number
|
||||
@@ -140,8 +140,8 @@ for (let x = 0, y = 1; x < 1; ++x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x, y;
|
||||
>x : any
|
||||
@@ -183,8 +183,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (let y = 0; y < 1; ++y) {
|
||||
>y : number
|
||||
@@ -265,8 +265,8 @@ for (const x = 0; x < 1;) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1;
|
||||
>x : number
|
||||
@@ -300,8 +300,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (const y = 0; y < 1;) {
|
||||
>y : number
|
||||
@@ -351,8 +351,8 @@ for (const x = 0, y = 1; x < 1;) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1, y = 1;
|
||||
>x : number
|
||||
@@ -398,8 +398,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (const y = 0; y < 1;) {
|
||||
>y : number
|
||||
|
||||
@@ -103,8 +103,8 @@ function foo2(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let a = arguments.length;
|
||||
>a : number
|
||||
@@ -158,8 +158,8 @@ function foo3(x) {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
}
|
||||
|
||||
function foo4(x) {
|
||||
@@ -249,8 +249,8 @@ function foo6(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x, y;
|
||||
>x : any
|
||||
@@ -317,8 +317,8 @@ function foo7(x) {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
}
|
||||
|
||||
|
||||
@@ -464,8 +464,8 @@ function foo2_c(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const a = arguments.length;
|
||||
>a : number
|
||||
@@ -520,8 +520,8 @@ function foo3_c(x) {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
}
|
||||
|
||||
function foo4_c(x) {
|
||||
@@ -607,8 +607,8 @@ function foo6_c(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1, y =1 ;
|
||||
>x : number
|
||||
@@ -679,8 +679,8 @@ function foo7_c(x) {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -102,8 +102,8 @@ function foo2(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let a = arguments.length;
|
||||
>a : number
|
||||
@@ -157,8 +157,8 @@ function foo3(x) {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
}
|
||||
|
||||
function foo4(x) {
|
||||
@@ -248,8 +248,8 @@ function foo6(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x, y;
|
||||
>x : any
|
||||
@@ -316,8 +316,8 @@ function foo7(x) {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
}
|
||||
|
||||
|
||||
@@ -463,8 +463,8 @@ function foo2_c(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const a = arguments.length;
|
||||
>a : number
|
||||
@@ -519,8 +519,8 @@ function foo3_c(x) {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
}
|
||||
|
||||
function foo4_c(x) {
|
||||
@@ -606,8 +606,8 @@ function foo6_c(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1, y =1 ;
|
||||
>x : number
|
||||
@@ -678,8 +678,8 @@ function foo7_c(x) {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -114,8 +114,8 @@ function foo2(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x = 1;
|
||||
>x : number
|
||||
@@ -173,8 +173,8 @@ function foo3(x) {
|
||||
|
||||
} while (1 === 1);
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
@@ -275,8 +275,8 @@ function foo6(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x, y;
|
||||
>x : any
|
||||
@@ -344,8 +344,8 @@ function foo7(x) {
|
||||
|
||||
} while (1 === 1);
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
@@ -508,8 +508,8 @@ function foo2_c(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1;
|
||||
>x : number
|
||||
@@ -568,8 +568,8 @@ function foo3_c(x) {
|
||||
|
||||
} while (1 === 1);
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
@@ -666,8 +666,8 @@ function foo6_c(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1, y = 1;
|
||||
>x : number
|
||||
@@ -739,8 +739,8 @@ function foo7_c(x) {
|
||||
|
||||
} while (1 === 1);
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
|
||||
@@ -115,8 +115,8 @@ function foo2(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x = 1;
|
||||
>x : number
|
||||
@@ -174,8 +174,8 @@ function foo3(x) {
|
||||
|
||||
} while (1 === 1);
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
@@ -276,8 +276,8 @@ function foo6(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x, y;
|
||||
>x : any
|
||||
@@ -345,8 +345,8 @@ function foo7(x) {
|
||||
|
||||
} while (1 === 1);
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
@@ -509,8 +509,8 @@ function foo2_c(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1;
|
||||
>x : number
|
||||
@@ -569,8 +569,8 @@ function foo3_c(x) {
|
||||
|
||||
} while (1 === 1);
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
@@ -667,8 +667,8 @@ function foo6_c(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1, y = 1;
|
||||
>x : number
|
||||
@@ -740,8 +740,8 @@ function foo7_c(x) {
|
||||
|
||||
} while (1 === 1);
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
|
||||
@@ -96,8 +96,8 @@ for (let x = 0; x < 1; ++x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x;
|
||||
>x : any
|
||||
@@ -141,8 +141,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (let y = 0; y < 1; ++y) {
|
||||
>y : number
|
||||
@@ -208,8 +208,8 @@ for (let x = 0, y = 1; x < 1; ++x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x, y;
|
||||
>x : any
|
||||
@@ -263,8 +263,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (let y = 0; y < 1; ++y) {
|
||||
>y : number
|
||||
@@ -394,8 +394,8 @@ for (const x = 0; x < 1;) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x =1;
|
||||
>x : number
|
||||
@@ -441,8 +441,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (const y = 0; y < 1;) {
|
||||
>y : number
|
||||
@@ -504,8 +504,8 @@ for (const x = 0, y = 1; x < 1;) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1, y = 1;
|
||||
>x : number
|
||||
@@ -563,8 +563,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (const y = 0; y < 1;) {
|
||||
>y : number
|
||||
|
||||
@@ -96,8 +96,8 @@ for (let x = 0; x < 1; ++x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x;
|
||||
>x : any
|
||||
@@ -141,8 +141,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (let y = 0; y < 1; ++y) {
|
||||
>y : number
|
||||
@@ -208,8 +208,8 @@ for (let x = 0, y = 1; x < 1; ++x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x, y;
|
||||
>x : any
|
||||
@@ -263,8 +263,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (let y = 0; y < 1; ++y) {
|
||||
>y : number
|
||||
@@ -394,8 +394,8 @@ for (const x = 0; x < 1;) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x =1;
|
||||
>x : number
|
||||
@@ -441,8 +441,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (const y = 0; y < 1;) {
|
||||
>y : number
|
||||
@@ -504,8 +504,8 @@ for (const x = 0, y = 1; x < 1;) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1, y = 1;
|
||||
>x : number
|
||||
@@ -563,8 +563,8 @@ do {
|
||||
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (const y = 0; y < 1;) {
|
||||
>y : number
|
||||
|
||||
@@ -33,7 +33,7 @@ function foo0(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ function foo00(x) {
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ function foo1(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -138,8 +138,8 @@ function foo2(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x = 1;
|
||||
>x : number
|
||||
@@ -166,7 +166,7 @@ function foo2(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -206,14 +206,14 @@ function foo3(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
@@ -259,7 +259,7 @@ function foo4(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -311,7 +311,7 @@ function foo5(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -330,8 +330,8 @@ function foo6(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x, y;
|
||||
>x : any
|
||||
@@ -362,7 +362,7 @@ function foo6(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -408,14 +408,14 @@ function foo7(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
} while (1 === 1);
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
@@ -466,7 +466,7 @@ function foo8(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -508,7 +508,7 @@ function foo0_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -549,7 +549,7 @@ function foo00_c(x) {
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -593,7 +593,7 @@ function foo1_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -611,8 +611,8 @@ function foo2_c(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1;
|
||||
>x : number
|
||||
@@ -639,7 +639,7 @@ function foo2_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -680,14 +680,14 @@ function foo3_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
@@ -731,7 +731,7 @@ function foo4_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -781,7 +781,7 @@ function foo5_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -800,8 +800,8 @@ function foo6_c(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1, y = 1;
|
||||
>x : number
|
||||
@@ -834,7 +834,7 @@ function foo6_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -882,14 +882,14 @@ function foo7_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
@@ -938,7 +938,7 @@ function foo8_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ function foo0(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ function foo00(x) {
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ function foo1(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -139,8 +139,8 @@ function foo2(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x = 1;
|
||||
>x : number
|
||||
@@ -167,7 +167,7 @@ function foo2(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -207,14 +207,14 @@ function foo3(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
@@ -260,7 +260,7 @@ function foo4(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -312,7 +312,7 @@ function foo5(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -331,8 +331,8 @@ function foo6(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x, y;
|
||||
>x : any
|
||||
@@ -363,7 +363,7 @@ function foo6(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -409,14 +409,14 @@ function foo7(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
} while (1 === 1);
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
@@ -467,7 +467,7 @@ function foo8(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -509,7 +509,7 @@ function foo0_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -550,7 +550,7 @@ function foo00_c(x) {
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -594,7 +594,7 @@ function foo1_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -612,8 +612,8 @@ function foo2_c(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1;
|
||||
>x : number
|
||||
@@ -640,7 +640,7 @@ function foo2_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -681,14 +681,14 @@ function foo3_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
@@ -732,7 +732,7 @@ function foo4_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -782,7 +782,7 @@ function foo5_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -801,8 +801,8 @@ function foo6_c(x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1, y = 1;
|
||||
>x : number
|
||||
@@ -835,7 +835,7 @@ function foo6_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -883,14 +883,14 @@ function foo7_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
use(v);
|
||||
>use(v) : any
|
||||
@@ -939,7 +939,7 @@ function foo8_c(x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -17,14 +17,14 @@ for (let x of []) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -47,14 +47,14 @@ for (let x in []) {
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == "2") {
|
||||
>x == "2" : boolean
|
||||
>x : string
|
||||
>"2" : string
|
||||
>"2" : "2"
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -83,14 +83,14 @@ for (let x = 0; x < 1; ++x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -98,8 +98,8 @@ for (let x = 0; x < 1; ++x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x;
|
||||
>x : any
|
||||
@@ -117,14 +117,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -147,21 +147,21 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (let y = 0; y < 1; ++y) {
|
||||
>y : number
|
||||
@@ -189,14 +189,14 @@ for (let y = 0; y < 1; ++y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -230,14 +230,14 @@ for (let x = 0, y = 1; x < 1; ++x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -245,8 +245,8 @@ for (let x = 0, y = 1; x < 1; ++x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x, y;
|
||||
>x : any
|
||||
@@ -269,14 +269,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -304,21 +304,21 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (let y = 0; y < 1; ++y) {
|
||||
>y : number
|
||||
@@ -350,14 +350,14 @@ for (let y = 0; y < 1; ++y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -382,14 +382,14 @@ for (const x of []) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -412,14 +412,14 @@ for (const x in []) {
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == "2") {
|
||||
>x == "2" : boolean
|
||||
>x : string
|
||||
>"2" : string
|
||||
>"2" : "2"
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -446,14 +446,14 @@ for (const x = 0; x < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -461,8 +461,8 @@ for (const x = 0; x < 1;) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1;
|
||||
>x : number
|
||||
@@ -481,14 +481,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -512,21 +512,21 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (const y = 0; y < 1;) {
|
||||
>y : number
|
||||
@@ -552,14 +552,14 @@ for (const y = 0; y < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -591,14 +591,14 @@ for (const x = 0, y = 1; x < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -606,8 +606,8 @@ for (const x = 0, y = 1; x < 1;) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1, y = 1;
|
||||
>x : number
|
||||
@@ -632,14 +632,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -669,21 +669,21 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (const y = 0; y < 1;) {
|
||||
>y : number
|
||||
@@ -713,14 +713,14 @@ for (const y = 0; y < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -17,14 +17,14 @@ for (let x of []) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -47,14 +47,14 @@ for (let x in []) {
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == "2") {
|
||||
>x == "2" : boolean
|
||||
>x : string
|
||||
>"2" : string
|
||||
>"2" : "2"
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -83,14 +83,14 @@ for (let x = 0; x < 1; ++x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -98,8 +98,8 @@ for (let x = 0; x < 1; ++x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x;
|
||||
>x : any
|
||||
@@ -117,14 +117,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -147,21 +147,21 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (let y = 0; y < 1; ++y) {
|
||||
>y : number
|
||||
@@ -189,14 +189,14 @@ for (let y = 0; y < 1; ++y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -230,14 +230,14 @@ for (let x = 0, y = 1; x < 1; ++x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -245,8 +245,8 @@ for (let x = 0, y = 1; x < 1; ++x) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x, y;
|
||||
>x : any
|
||||
@@ -269,14 +269,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -304,21 +304,21 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (let y = 0; y < 1; ++y) {
|
||||
>y : number
|
||||
@@ -350,14 +350,14 @@ for (let y = 0; y < 1; ++y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -382,14 +382,14 @@ for (const x of []) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -412,14 +412,14 @@ for (const x in []) {
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == "2") {
|
||||
>x == "2" : boolean
|
||||
>x : string
|
||||
>"2" : string
|
||||
>"2" : "2"
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -446,14 +446,14 @@ for (const x = 0; x < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -461,8 +461,8 @@ for (const x = 0; x < 1;) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1;
|
||||
>x : number
|
||||
@@ -481,14 +481,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -512,21 +512,21 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (const y = 0; y < 1;) {
|
||||
>y : number
|
||||
@@ -552,14 +552,14 @@ for (const y = 0; y < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -591,14 +591,14 @@ for (const x = 0, y = 1; x < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -606,8 +606,8 @@ for (const x = 0, y = 1; x < 1;) {
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1, y = 1;
|
||||
>x : number
|
||||
@@ -632,14 +632,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -669,21 +669,21 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
for (const y = 0; y < 1;) {
|
||||
>y : number
|
||||
@@ -713,14 +713,14 @@ for (const y = 0; y < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -20,14 +20,14 @@ for (let x of []) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l0;
|
||||
>l0 : any
|
||||
@@ -35,14 +35,14 @@ for (let x of []) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l0;
|
||||
>l0 : any
|
||||
@@ -69,14 +69,14 @@ for (let x in []) {
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
break l00;
|
||||
>l00 : any
|
||||
@@ -84,14 +84,14 @@ for (let x in []) {
|
||||
if (x == "2") {
|
||||
>x == "2" : boolean
|
||||
>x : string
|
||||
>"2" : string
|
||||
>"2" : "2"
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == "2") {
|
||||
>x == "2" : boolean
|
||||
>x : string
|
||||
>"2" : string
|
||||
>"2" : "2"
|
||||
|
||||
continue l00;
|
||||
>l00 : any
|
||||
@@ -123,14 +123,14 @@ for (let x = 0; x < 1; ++x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l1;
|
||||
>l1 : any
|
||||
@@ -138,14 +138,14 @@ for (let x = 0; x < 1; ++x) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l1;
|
||||
>l1 : any
|
||||
@@ -157,8 +157,8 @@ l2:
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x;
|
||||
>x : any
|
||||
@@ -176,14 +176,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l2;
|
||||
>l2 : any
|
||||
@@ -191,14 +191,14 @@ while (1 === 1) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l2;
|
||||
>l2 : any
|
||||
@@ -225,14 +225,14 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l3;
|
||||
>l3 : any
|
||||
@@ -240,22 +240,22 @@ do {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l3;
|
||||
>l3 : any
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
l4:
|
||||
>l4 : any
|
||||
@@ -286,14 +286,14 @@ for (let y = 0; y < 1; ++y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l4;
|
||||
>l4 : any
|
||||
@@ -301,14 +301,14 @@ for (let y = 0; y < 1; ++y) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l4;
|
||||
>l4 : any
|
||||
@@ -346,14 +346,14 @@ for (let x = 0, y = 1; x < 1; ++x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l5;
|
||||
>l5 : any
|
||||
@@ -361,14 +361,14 @@ for (let x = 0, y = 1; x < 1; ++x) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l5;
|
||||
>l5 : any
|
||||
@@ -380,8 +380,8 @@ l6:
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x, y;
|
||||
>x : any
|
||||
@@ -404,14 +404,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l6;
|
||||
>l6 : any
|
||||
@@ -419,14 +419,14 @@ while (1 === 1) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l6;
|
||||
>l6 : any
|
||||
@@ -459,14 +459,14 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l7;
|
||||
>l7 : any
|
||||
@@ -474,22 +474,22 @@ do {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l7;
|
||||
>l7 : any
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
l8:
|
||||
>l8 : any
|
||||
@@ -524,14 +524,14 @@ for (let y = 0; y < 1; ++y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l8;
|
||||
>l8 : any
|
||||
@@ -539,14 +539,14 @@ for (let y = 0; y < 1; ++y) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l8;
|
||||
>l8 : any
|
||||
@@ -574,14 +574,14 @@ for (const x of []) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l0_c;
|
||||
>l0_c : any
|
||||
@@ -589,14 +589,14 @@ for (const x of []) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l0_c;
|
||||
>l0_c : any
|
||||
@@ -623,14 +623,14 @@ for (const x in []) {
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
break l00_c;
|
||||
>l00_c : any
|
||||
@@ -638,14 +638,14 @@ for (const x in []) {
|
||||
if (x == "2") {
|
||||
>x == "2" : boolean
|
||||
>x : string
|
||||
>"2" : string
|
||||
>"2" : "2"
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == "2") {
|
||||
>x == "2" : boolean
|
||||
>x : string
|
||||
>"2" : string
|
||||
>"2" : "2"
|
||||
|
||||
continue l00_c;
|
||||
>l00_c : any
|
||||
@@ -675,14 +675,14 @@ for (const x = 0; x < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l1_c;
|
||||
>l1_c : any
|
||||
@@ -690,14 +690,14 @@ for (const x = 0; x < 1;) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l1_c;
|
||||
>l1_c : any
|
||||
@@ -709,8 +709,8 @@ l2_c:
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1;
|
||||
>x : number
|
||||
@@ -729,14 +729,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l2_c;
|
||||
>l2_c : any
|
||||
@@ -744,14 +744,14 @@ while (1 === 1) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l2_c;
|
||||
>l2_c : any
|
||||
@@ -779,14 +779,14 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l3_c;
|
||||
>l3_c : any
|
||||
@@ -794,22 +794,22 @@ do {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l3_c;
|
||||
>l3_c : any
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
l4_c:
|
||||
>l4_c : any
|
||||
@@ -838,14 +838,14 @@ for (const y = 0; y < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l4_c;
|
||||
>l4_c : any
|
||||
@@ -853,14 +853,14 @@ for (const y = 0; y < 1;) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l4_c;
|
||||
>l4_c : any
|
||||
@@ -896,14 +896,14 @@ for (const x = 0, y = 1; x < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l5_c;
|
||||
>l5_c : any
|
||||
@@ -911,14 +911,14 @@ for (const x = 0, y = 1; x < 1;) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l5_c;
|
||||
>l5_c : any
|
||||
@@ -930,8 +930,8 @@ l6_c:
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1, y = 1;
|
||||
>x : number
|
||||
@@ -956,14 +956,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l6_c;
|
||||
>l6_c : any
|
||||
@@ -971,14 +971,14 @@ while (1 === 1) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l6_c;
|
||||
>l6_c : any
|
||||
@@ -1013,14 +1013,14 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l7_c;
|
||||
>l7_c : any
|
||||
@@ -1028,22 +1028,22 @@ do {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l7_c;
|
||||
>l7_c : any
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
l8_c:
|
||||
>l8_c : any
|
||||
@@ -1076,14 +1076,14 @@ for (const y = 0; y < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l8_c;
|
||||
>l8_c : any
|
||||
@@ -1091,14 +1091,14 @@ for (const y = 0; y < 1;) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l8_c;
|
||||
>l8_c : any
|
||||
|
||||
@@ -20,14 +20,14 @@ for (let x of []) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l0;
|
||||
>l0 : any
|
||||
@@ -35,14 +35,14 @@ for (let x of []) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l0;
|
||||
>l0 : any
|
||||
@@ -69,14 +69,14 @@ for (let x in []) {
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
break l00;
|
||||
>l00 : any
|
||||
@@ -84,14 +84,14 @@ for (let x in []) {
|
||||
if (x == "2") {
|
||||
>x == "2" : boolean
|
||||
>x : string
|
||||
>"2" : string
|
||||
>"2" : "2"
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == "2") {
|
||||
>x == "2" : boolean
|
||||
>x : string
|
||||
>"2" : string
|
||||
>"2" : "2"
|
||||
|
||||
continue l00;
|
||||
>l00 : any
|
||||
@@ -123,14 +123,14 @@ for (let x = 0; x < 1; ++x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l1;
|
||||
>l1 : any
|
||||
@@ -138,14 +138,14 @@ for (let x = 0; x < 1; ++x) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l1;
|
||||
>l1 : any
|
||||
@@ -157,8 +157,8 @@ l2:
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x;
|
||||
>x : any
|
||||
@@ -176,14 +176,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l2;
|
||||
>l2 : any
|
||||
@@ -191,14 +191,14 @@ while (1 === 1) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l2;
|
||||
>l2 : any
|
||||
@@ -225,14 +225,14 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l3;
|
||||
>l3 : any
|
||||
@@ -240,22 +240,22 @@ do {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l3;
|
||||
>l3 : any
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
l4:
|
||||
>l4 : any
|
||||
@@ -286,14 +286,14 @@ for (let y = 0; y < 1; ++y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l4;
|
||||
>l4 : any
|
||||
@@ -301,14 +301,14 @@ for (let y = 0; y < 1; ++y) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l4;
|
||||
>l4 : any
|
||||
@@ -346,14 +346,14 @@ for (let x = 0, y = 1; x < 1; ++x) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l5;
|
||||
>l5 : any
|
||||
@@ -361,14 +361,14 @@ for (let x = 0, y = 1; x < 1; ++x) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l5;
|
||||
>l5 : any
|
||||
@@ -380,8 +380,8 @@ l6:
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x, y;
|
||||
>x : any
|
||||
@@ -404,14 +404,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l6;
|
||||
>l6 : any
|
||||
@@ -419,14 +419,14 @@ while (1 === 1) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l6;
|
||||
>l6 : any
|
||||
@@ -459,14 +459,14 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l7;
|
||||
>l7 : any
|
||||
@@ -474,22 +474,22 @@ do {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l7;
|
||||
>l7 : any
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
l8:
|
||||
>l8 : any
|
||||
@@ -524,14 +524,14 @@ for (let y = 0; y < 1; ++y) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l8;
|
||||
>l8 : any
|
||||
@@ -539,14 +539,14 @@ for (let y = 0; y < 1; ++y) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l8;
|
||||
>l8 : any
|
||||
@@ -574,14 +574,14 @@ for (const x of []) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l0_c;
|
||||
>l0_c : any
|
||||
@@ -589,14 +589,14 @@ for (const x of []) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l0_c;
|
||||
>l0_c : any
|
||||
@@ -623,14 +623,14 @@ for (const x in []) {
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == "1") {
|
||||
>x == "1" : boolean
|
||||
>x : string
|
||||
>"1" : string
|
||||
>"1" : "1"
|
||||
|
||||
break l00_c;
|
||||
>l00_c : any
|
||||
@@ -638,14 +638,14 @@ for (const x in []) {
|
||||
if (x == "2") {
|
||||
>x == "2" : boolean
|
||||
>x : string
|
||||
>"2" : string
|
||||
>"2" : "2"
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == "2") {
|
||||
>x == "2" : boolean
|
||||
>x : string
|
||||
>"2" : string
|
||||
>"2" : "2"
|
||||
|
||||
continue l00_c;
|
||||
>l00_c : any
|
||||
@@ -675,14 +675,14 @@ for (const x = 0; x < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l1_c;
|
||||
>l1_c : any
|
||||
@@ -690,14 +690,14 @@ for (const x = 0; x < 1;) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l1_c;
|
||||
>l1_c : any
|
||||
@@ -709,8 +709,8 @@ l2_c:
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1;
|
||||
>x : number
|
||||
@@ -729,14 +729,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l2_c;
|
||||
>l2_c : any
|
||||
@@ -744,14 +744,14 @@ while (1 === 1) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l2_c;
|
||||
>l2_c : any
|
||||
@@ -779,14 +779,14 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l3_c;
|
||||
>l3_c : any
|
||||
@@ -794,22 +794,22 @@ do {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l3_c;
|
||||
>l3_c : any
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
l4_c:
|
||||
>l4_c : any
|
||||
@@ -838,14 +838,14 @@ for (const y = 0; y < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l4_c;
|
||||
>l4_c : any
|
||||
@@ -853,14 +853,14 @@ for (const y = 0; y < 1;) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l4_c;
|
||||
>l4_c : any
|
||||
@@ -896,14 +896,14 @@ for (const x = 0, y = 1; x < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l5_c;
|
||||
>l5_c : any
|
||||
@@ -911,14 +911,14 @@ for (const x = 0, y = 1; x < 1;) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l5_c;
|
||||
>l5_c : any
|
||||
@@ -930,8 +930,8 @@ l6_c:
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
const x = 1, y = 1;
|
||||
>x : number
|
||||
@@ -956,14 +956,14 @@ while (1 === 1) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l6_c;
|
||||
>l6_c : any
|
||||
@@ -971,14 +971,14 @@ while (1 === 1) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l6_c;
|
||||
>l6_c : any
|
||||
@@ -1013,14 +1013,14 @@ do {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l7_c;
|
||||
>l7_c : any
|
||||
@@ -1028,22 +1028,22 @@ do {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l7_c;
|
||||
>l7_c : any
|
||||
}
|
||||
} while (1 === 1)
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
l8_c:
|
||||
>l8_c : any
|
||||
@@ -1076,14 +1076,14 @@ for (const y = 0; y < 1;) {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l8_c;
|
||||
>l8_c : any
|
||||
@@ -1091,14 +1091,14 @@ for (const y = 0; y < 1;) {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l8_c;
|
||||
>l8_c : any
|
||||
|
||||
@@ -55,14 +55,14 @@ function foo() {
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l1;
|
||||
>l1 : any
|
||||
@@ -70,7 +70,7 @@ function foo() {
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break ll1;
|
||||
>ll1 : any
|
||||
@@ -78,7 +78,7 @@ function foo() {
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
continue l0;
|
||||
>l0 : any
|
||||
@@ -87,14 +87,14 @@ function foo() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l1;
|
||||
>l1 : any
|
||||
@@ -102,7 +102,7 @@ function foo() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue ll1;
|
||||
>ll1 : any
|
||||
@@ -110,7 +110,7 @@ function foo() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
return "123"
|
||||
>"123" : string
|
||||
@@ -118,7 +118,7 @@ function foo() {
|
||||
if (x == 3) {
|
||||
>x == 3 : boolean
|
||||
>x : number
|
||||
>3 : number
|
||||
>3 : 3
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -126,14 +126,14 @@ function foo() {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l1;
|
||||
>l1 : any
|
||||
@@ -141,14 +141,14 @@ function foo() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l1;
|
||||
>l1 : any
|
||||
@@ -156,7 +156,7 @@ function foo() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l0;
|
||||
>l0 : any
|
||||
@@ -164,7 +164,7 @@ function foo() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
return "456";
|
||||
>"456" : string
|
||||
@@ -172,7 +172,7 @@ function foo() {
|
||||
if (x == 3) {
|
||||
>x == 3 : boolean
|
||||
>x : number
|
||||
>3 : number
|
||||
>3 : 3
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -230,14 +230,14 @@ function foo_c() {
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l1;
|
||||
>l1 : any
|
||||
@@ -245,7 +245,7 @@ function foo_c() {
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break ll1;
|
||||
>ll1 : any
|
||||
@@ -253,7 +253,7 @@ function foo_c() {
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
continue l0;
|
||||
>l0 : any
|
||||
@@ -262,14 +262,14 @@ function foo_c() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l1;
|
||||
>l1 : any
|
||||
@@ -277,7 +277,7 @@ function foo_c() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue ll1;
|
||||
>ll1 : any
|
||||
@@ -285,7 +285,7 @@ function foo_c() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
return "123"
|
||||
>"123" : string
|
||||
@@ -293,7 +293,7 @@ function foo_c() {
|
||||
if (x == 3) {
|
||||
>x == 3 : boolean
|
||||
>x : number
|
||||
>3 : number
|
||||
>3 : 3
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -301,14 +301,14 @@ function foo_c() {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l1;
|
||||
>l1 : any
|
||||
@@ -316,14 +316,14 @@ function foo_c() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l1;
|
||||
>l1 : any
|
||||
@@ -331,7 +331,7 @@ function foo_c() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l0;
|
||||
>l0 : any
|
||||
@@ -339,7 +339,7 @@ function foo_c() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
return "456";
|
||||
>"456" : string
|
||||
@@ -347,7 +347,7 @@ function foo_c() {
|
||||
if (x == 3) {
|
||||
>x == 3 : boolean
|
||||
>x : number
|
||||
>3 : number
|
||||
>3 : 3
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -55,14 +55,14 @@ function foo() {
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l1;
|
||||
>l1 : any
|
||||
@@ -70,7 +70,7 @@ function foo() {
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break ll1;
|
||||
>ll1 : any
|
||||
@@ -78,7 +78,7 @@ function foo() {
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
continue l0;
|
||||
>l0 : any
|
||||
@@ -87,14 +87,14 @@ function foo() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l1;
|
||||
>l1 : any
|
||||
@@ -102,7 +102,7 @@ function foo() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue ll1;
|
||||
>ll1 : any
|
||||
@@ -110,7 +110,7 @@ function foo() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
return "123"
|
||||
>"123" : string
|
||||
@@ -118,7 +118,7 @@ function foo() {
|
||||
if (x == 3) {
|
||||
>x == 3 : boolean
|
||||
>x : number
|
||||
>3 : number
|
||||
>3 : 3
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -126,14 +126,14 @@ function foo() {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l1;
|
||||
>l1 : any
|
||||
@@ -141,14 +141,14 @@ function foo() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l1;
|
||||
>l1 : any
|
||||
@@ -156,7 +156,7 @@ function foo() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l0;
|
||||
>l0 : any
|
||||
@@ -164,7 +164,7 @@ function foo() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
return "456";
|
||||
>"456" : string
|
||||
@@ -172,7 +172,7 @@ function foo() {
|
||||
if (x == 3) {
|
||||
>x == 3 : boolean
|
||||
>x : number
|
||||
>3 : number
|
||||
>3 : 3
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -230,14 +230,14 @@ function foo_c() {
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l1;
|
||||
>l1 : any
|
||||
@@ -245,7 +245,7 @@ function foo_c() {
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break ll1;
|
||||
>ll1 : any
|
||||
@@ -253,7 +253,7 @@ function foo_c() {
|
||||
if (y == 1) {
|
||||
>y == 1 : boolean
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
continue l0;
|
||||
>l0 : any
|
||||
@@ -262,14 +262,14 @@ function foo_c() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l1;
|
||||
>l1 : any
|
||||
@@ -277,7 +277,7 @@ function foo_c() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue ll1;
|
||||
>ll1 : any
|
||||
@@ -285,7 +285,7 @@ function foo_c() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
return "123"
|
||||
>"123" : string
|
||||
@@ -293,7 +293,7 @@ function foo_c() {
|
||||
if (x == 3) {
|
||||
>x == 3 : boolean
|
||||
>x : number
|
||||
>3 : number
|
||||
>3 : 3
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -301,14 +301,14 @@ function foo_c() {
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
if (x == 1) {
|
||||
>x == 1 : boolean
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break l1;
|
||||
>l1 : any
|
||||
@@ -316,14 +316,14 @@ function foo_c() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l1;
|
||||
>l1 : any
|
||||
@@ -331,7 +331,7 @@ function foo_c() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue l0;
|
||||
>l0 : any
|
||||
@@ -339,7 +339,7 @@ function foo_c() {
|
||||
if (x == 2) {
|
||||
>x == 2 : boolean
|
||||
>x : number
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
return "456";
|
||||
>"456" : string
|
||||
@@ -347,7 +347,7 @@ function foo_c() {
|
||||
if (x == 3) {
|
||||
>x == 3 : boolean
|
||||
>x : number
|
||||
>3 : number
|
||||
>3 : 3
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ for (let x = 0; x < 1; ++x) {
|
||||
>x : any
|
||||
|
||||
case 1:
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
let x;
|
||||
>x : any
|
||||
@@ -57,8 +57,8 @@ for (let x = 0; x < 1; ++x) {
|
||||
|
||||
while (1 == 1) {
|
||||
>1 == 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x;
|
||||
>x : any
|
||||
@@ -100,7 +100,7 @@ function foo() {
|
||||
if (a === 1) {
|
||||
>a === 1 : boolean
|
||||
>a : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ function foo() {
|
||||
if (a === 2) {
|
||||
>a === 2 : boolean
|
||||
>a : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
break l0;
|
||||
>l0 : any
|
||||
@@ -132,7 +132,7 @@ function foo() {
|
||||
if (b === 1) {
|
||||
>b === 1 : boolean
|
||||
>b : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -141,7 +141,7 @@ function foo() {
|
||||
if (b === 2) {
|
||||
>b === 2 : boolean
|
||||
>b : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
break l0;
|
||||
>l0 : any
|
||||
@@ -153,7 +153,7 @@ function foo() {
|
||||
if (b === 3) {
|
||||
>b === 3 : boolean
|
||||
>b : any
|
||||
>3 : number
|
||||
>3 : 3
|
||||
|
||||
break l1;
|
||||
>l1 : any
|
||||
@@ -183,7 +183,7 @@ function foo() {
|
||||
if (b === 1) {
|
||||
>b === 1 : boolean
|
||||
>b : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -191,7 +191,7 @@ function foo() {
|
||||
if (b === 2) {
|
||||
>b === 2 : boolean
|
||||
>b : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
break l0;
|
||||
>l0 : any
|
||||
@@ -242,22 +242,22 @@ function foo2() {
|
||||
if (x === 1) {
|
||||
>x === 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
else if (x === 2) {
|
||||
>x === 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
if (x) {
|
||||
>x : any
|
||||
@@ -273,10 +273,10 @@ function foo2() {
|
||||
>x : any
|
||||
|
||||
case 1: break;
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
case 2: continue;
|
||||
>2 : number
|
||||
>2 : 2
|
||||
}
|
||||
|
||||
for (let y of []) {
|
||||
@@ -287,10 +287,10 @@ function foo2() {
|
||||
>y : any
|
||||
|
||||
case 1: break;
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
case 2: continue;
|
||||
>2 : number
|
||||
>2 : 2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ for (let x = 0; x < 1; ++x) {
|
||||
>x : any
|
||||
|
||||
case 1:
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
let x;
|
||||
>x : any
|
||||
@@ -58,8 +58,8 @@ for (let x = 0; x < 1; ++x) {
|
||||
|
||||
while (1 == 1) {
|
||||
>1 == 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
let x;
|
||||
>x : any
|
||||
@@ -101,7 +101,7 @@ function foo() {
|
||||
if (a === 1) {
|
||||
>a === 1 : boolean
|
||||
>a : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ function foo() {
|
||||
if (a === 2) {
|
||||
>a === 2 : boolean
|
||||
>a : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
break l0;
|
||||
>l0 : any
|
||||
@@ -133,7 +133,7 @@ function foo() {
|
||||
if (b === 1) {
|
||||
>b === 1 : boolean
|
||||
>b : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -142,7 +142,7 @@ function foo() {
|
||||
if (b === 2) {
|
||||
>b === 2 : boolean
|
||||
>b : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
break l0;
|
||||
>l0 : any
|
||||
@@ -154,7 +154,7 @@ function foo() {
|
||||
if (b === 3) {
|
||||
>b === 3 : boolean
|
||||
>b : any
|
||||
>3 : number
|
||||
>3 : 3
|
||||
|
||||
break l1;
|
||||
>l1 : any
|
||||
@@ -184,7 +184,7 @@ function foo() {
|
||||
if (b === 1) {
|
||||
>b === 1 : boolean
|
||||
>b : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -192,7 +192,7 @@ function foo() {
|
||||
if (b === 2) {
|
||||
>b === 2 : boolean
|
||||
>b : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
break l0;
|
||||
>l0 : any
|
||||
@@ -242,22 +242,22 @@ function foo2() {
|
||||
if (x === 1) {
|
||||
>x === 1 : boolean
|
||||
>x : any
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
break;
|
||||
}
|
||||
else if (x === 2) {
|
||||
>x === 2 : boolean
|
||||
>x : any
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
while (1 === 1) {
|
||||
>1 === 1 : boolean
|
||||
>1 : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>1 : 1
|
||||
|
||||
if (x) {
|
||||
>x : any
|
||||
@@ -273,10 +273,10 @@ function foo2() {
|
||||
>x : any
|
||||
|
||||
case 1: break;
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
case 2: continue;
|
||||
>2 : number
|
||||
>2 : 2
|
||||
}
|
||||
|
||||
for (let y of []) {
|
||||
@@ -287,10 +287,10 @@ function foo2() {
|
||||
>y : any
|
||||
|
||||
case 1: break;
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
case 2: continue;
|
||||
>2 : number
|
||||
>2 : 2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class A {
|
||||
>v : string
|
||||
|
||||
case "test": use(this);
|
||||
>"test" : string
|
||||
>"test" : "test"
|
||||
>use(this) : void
|
||||
>use : (a: any) => void
|
||||
>this : this
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
=== tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithClass.ts ===
|
||||
var v0: T0;
|
||||
>v0 : string | I0
|
||||
>T0 : string | I0
|
||||
>v0 : T0
|
||||
>T0 : T0
|
||||
|
||||
type T0 = string | I0;
|
||||
>T0 : string | I0
|
||||
>T0 : T0
|
||||
>I0 : I0
|
||||
|
||||
class I0 {
|
||||
>I0 : I0
|
||||
|
||||
x: T0;
|
||||
>x : string | I0
|
||||
>T0 : string | I0
|
||||
>x : T0
|
||||
>T0 : T0
|
||||
}
|
||||
|
||||
var v3: T3;
|
||||
>v3 : string | I3
|
||||
>T3 : string | I3
|
||||
>v3 : T3
|
||||
>T3 : T3
|
||||
|
||||
type T3 = string | I3;
|
||||
>T3 : string | I3
|
||||
>T3 : T3
|
||||
>I3 : I3
|
||||
|
||||
class I3 {
|
||||
@@ -28,15 +28,15 @@ class I3 {
|
||||
|
||||
[x: number]: T3;
|
||||
>x : number
|
||||
>T3 : string | I3
|
||||
>T3 : T3
|
||||
}
|
||||
|
||||
var v4: T4;
|
||||
>v4 : string | I4
|
||||
>T4 : string | I4
|
||||
>v4 : T4
|
||||
>T4 : T4
|
||||
|
||||
type T4 = string | I4;
|
||||
>T4 : string | I4
|
||||
>T4 : T4
|
||||
>I4 : I4
|
||||
|
||||
class I4 {
|
||||
@@ -44,6 +44,6 @@ class I4 {
|
||||
|
||||
[x: string]: T4;
|
||||
>x : string
|
||||
>T4 : string | I4
|
||||
>T4 : T4
|
||||
}
|
||||
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
=== tests/cases/conformance/types/typeAliases/circularTypeAliasForUnionWithInterface.ts ===
|
||||
var v0: T0;
|
||||
>v0 : string | I0
|
||||
>T0 : string | I0
|
||||
>v0 : T0
|
||||
>T0 : T0
|
||||
|
||||
type T0 = string | I0;
|
||||
>T0 : string | I0
|
||||
>T0 : T0
|
||||
>I0 : I0
|
||||
|
||||
interface I0 {
|
||||
>I0 : I0
|
||||
|
||||
x: T0;
|
||||
>x : string | I0
|
||||
>T0 : string | I0
|
||||
>x : T0
|
||||
>T0 : T0
|
||||
}
|
||||
|
||||
var v1: T1;
|
||||
>v1 : string | I1
|
||||
>T1 : string | I1
|
||||
>v1 : T1
|
||||
>T1 : T1
|
||||
|
||||
type T1 = string | I1;
|
||||
>T1 : string | I1
|
||||
>T1 : T1
|
||||
>I1 : I1
|
||||
|
||||
interface I1 {
|
||||
>I1 : I1
|
||||
|
||||
(): T1;
|
||||
>T1 : string | I1
|
||||
>T1 : T1
|
||||
}
|
||||
|
||||
var v2: T2;
|
||||
>v2 : string | I2
|
||||
>T2 : string | I2
|
||||
>v2 : T2
|
||||
>T2 : T2
|
||||
|
||||
type T2 = string | I2;
|
||||
>T2 : string | I2
|
||||
>T2 : T2
|
||||
>I2 : I2
|
||||
|
||||
interface I2 {
|
||||
>I2 : I2
|
||||
|
||||
new (): T2;
|
||||
>T2 : string | I2
|
||||
>T2 : T2
|
||||
}
|
||||
|
||||
var v3: T3;
|
||||
>v3 : string | I3
|
||||
>T3 : string | I3
|
||||
>v3 : T3
|
||||
>T3 : T3
|
||||
|
||||
type T3 = string | I3;
|
||||
>T3 : string | I3
|
||||
>T3 : T3
|
||||
>I3 : I3
|
||||
|
||||
interface I3 {
|
||||
@@ -58,15 +58,15 @@ interface I3 {
|
||||
|
||||
[x: number]: T3;
|
||||
>x : number
|
||||
>T3 : string | I3
|
||||
>T3 : T3
|
||||
}
|
||||
|
||||
var v4: T4;
|
||||
>v4 : string | I4
|
||||
>T4 : string | I4
|
||||
>v4 : T4
|
||||
>T4 : T4
|
||||
|
||||
type T4 = string | I4;
|
||||
>T4 : string | I4
|
||||
>T4 : T4
|
||||
>I4 : I4
|
||||
|
||||
interface I4 {
|
||||
@@ -74,6 +74,6 @@ interface I4 {
|
||||
|
||||
[x: string]: T4;
|
||||
>x : string
|
||||
>T4 : string | I4
|
||||
>T4 : T4
|
||||
}
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
=== tests/cases/conformance/types/typeAliases/classDoesNotDependOnBaseTypes.ts ===
|
||||
var x: StringTree;
|
||||
>x : string | StringTreeCollection
|
||||
>StringTree : string | StringTreeCollection
|
||||
>x : StringTree
|
||||
>StringTree : StringTree
|
||||
|
||||
if (typeof x !== "string") {
|
||||
>typeof x !== "string" : boolean
|
||||
>typeof x : string
|
||||
>x : string | StringTreeCollection
|
||||
>"string" : string
|
||||
>x : StringTree
|
||||
>"string" : "string"
|
||||
|
||||
x[0] = "";
|
||||
>x[0] = "" : string
|
||||
>x[0] : string | StringTreeCollection
|
||||
>x[0] : StringTree
|
||||
>x : StringTreeCollection
|
||||
>0 : number
|
||||
>"" : string
|
||||
|
||||
x[0] = new StringTreeCollection;
|
||||
>x[0] = new StringTreeCollection : StringTreeCollection
|
||||
>x[0] : string | StringTreeCollection
|
||||
>x[0] : StringTree
|
||||
>x : StringTreeCollection
|
||||
>0 : number
|
||||
>new StringTreeCollection : StringTreeCollection
|
||||
@@ -26,7 +26,7 @@ if (typeof x !== "string") {
|
||||
}
|
||||
|
||||
type StringTree = string | StringTreeCollection;
|
||||
>StringTree : string | StringTreeCollection
|
||||
>StringTree : StringTree
|
||||
>StringTreeCollection : StringTreeCollection
|
||||
|
||||
class StringTreeCollectionBase {
|
||||
@@ -34,7 +34,7 @@ class StringTreeCollectionBase {
|
||||
|
||||
[n: number]: StringTree;
|
||||
>n : number
|
||||
>StringTree : string | StringTreeCollection
|
||||
>StringTree : StringTree
|
||||
}
|
||||
|
||||
class StringTreeCollection extends StringTreeCollectionBase { }
|
||||
|
||||
@@ -20,10 +20,10 @@ var x = Colors.Cornflower;
|
||||
>Cornflower : Colors
|
||||
|
||||
x = Colors.FancyPink;
|
||||
>x = Colors.FancyPink : Colors
|
||||
>x = Colors.FancyPink : Colors.FancyPink
|
||||
>x : Colors
|
||||
>Colors.FancyPink : Colors
|
||||
>Colors.FancyPink : Colors.FancyPink
|
||||
>Colors : typeof Colors
|
||||
>FancyPink : Colors
|
||||
>FancyPink : Colors.FancyPink
|
||||
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ const enum color { red, green, blue }
|
||||
var shade: color = color.green;
|
||||
>shade : color
|
||||
>color : color
|
||||
>color.green : color
|
||||
>color.green : color.green
|
||||
>color : typeof color
|
||||
>green : color
|
||||
>green : color.green
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ var e: number = <foo.E1>0;
|
||||
><foo.E1>0 : foo.E1
|
||||
>foo : any
|
||||
>E1 : foo.E1
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo_0.ts ===
|
||||
export class C1 {
|
||||
|
||||
@@ -208,34 +208,34 @@ var re2 = b == a;
|
||||
var re3 = E.a == b;
|
||||
>re3 : boolean
|
||||
>E.a == b : boolean
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var re4 = b == E.a;
|
||||
>re4 : boolean
|
||||
>b == E.a : boolean
|
||||
>b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var re5 = E.a == 0;
|
||||
>re5 : boolean
|
||||
>E.a == 0 : boolean
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>0 : number
|
||||
>a : E.a
|
||||
>0 : 0
|
||||
|
||||
var re6 = 0 == E.a;
|
||||
>re6 : boolean
|
||||
>0 == E.a : boolean
|
||||
>0 : number
|
||||
>E.a : E
|
||||
>0 : 0
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
// operator !=
|
||||
var rf1 = a != b;
|
||||
@@ -253,34 +253,34 @@ var rf2 = b != a;
|
||||
var rf3 = E.a != b;
|
||||
>rf3 : boolean
|
||||
>E.a != b : boolean
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rf4 = b != E.a;
|
||||
>rf4 : boolean
|
||||
>b != E.a : boolean
|
||||
>b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rf5 = E.a != 0;
|
||||
>rf5 : boolean
|
||||
>E.a != 0 : boolean
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>0 : number
|
||||
>a : E.a
|
||||
>0 : 0
|
||||
|
||||
var rf6 = 0 != E.a;
|
||||
>rf6 : boolean
|
||||
>0 != E.a : boolean
|
||||
>0 : number
|
||||
>E.a : E
|
||||
>0 : 0
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
// operator ===
|
||||
var rg1 = a === b;
|
||||
@@ -298,34 +298,34 @@ var rg2 = b === a;
|
||||
var rg3 = E.a === b;
|
||||
>rg3 : boolean
|
||||
>E.a === b : boolean
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rg4 = b === E.a;
|
||||
>rg4 : boolean
|
||||
>b === E.a : boolean
|
||||
>b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rg5 = E.a === 0;
|
||||
>rg5 : boolean
|
||||
>E.a === 0 : boolean
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>0 : number
|
||||
>a : E.a
|
||||
>0 : 0
|
||||
|
||||
var rg6 = 0 === E.a;
|
||||
>rg6 : boolean
|
||||
>0 === E.a : boolean
|
||||
>0 : number
|
||||
>E.a : E
|
||||
>0 : 0
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
// operator !==
|
||||
var rh1 = a !== b;
|
||||
@@ -343,32 +343,32 @@ var rh2 = b !== a;
|
||||
var rh3 = E.a !== b;
|
||||
>rh3 : boolean
|
||||
>E.a !== b : boolean
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rh4 = b !== E.a;
|
||||
>rh4 : boolean
|
||||
>b !== E.a : boolean
|
||||
>b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rh5 = E.a !== 0;
|
||||
>rh5 : boolean
|
||||
>E.a !== 0 : boolean
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>0 : number
|
||||
>a : E.a
|
||||
>0 : 0
|
||||
|
||||
var rh6 = 0 !== E.a;
|
||||
>rh6 : boolean
|
||||
>0 !== E.a : boolean
|
||||
>0 : number
|
||||
>E.a : E
|
||||
>0 : 0
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
|
||||
@@ -152,14 +152,14 @@ x4 += a;
|
||||
x4 += 0;
|
||||
>x4 += 0 : number
|
||||
>x4 : E
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
x4 += E.a;
|
||||
>x4 += E.a : number
|
||||
>x4 : E
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
x4 += null;
|
||||
>x4 += null : number
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames1_ES5.ts ===
|
||||
var v = {
|
||||
>v : { [x: number]: number | string; }
|
||||
>{ get [0 + 1]() { return 0 }, set [0 + 1](v: string) { } //No error} : { [x: number]: number | string; }
|
||||
>v : { [x: number]: string | number; }
|
||||
>{ get [0 + 1]() { return 0 }, set [0 + 1](v: string) { } //No error} : { [x: number]: string | number; }
|
||||
|
||||
get [0 + 1]() { return 0 },
|
||||
>0 + 1 : number
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames1_ES6.ts ===
|
||||
var v = {
|
||||
>v : { [x: number]: number | string; }
|
||||
>{ get [0 + 1]() { return 0 }, set [0 + 1](v: string) { } //No error} : { [x: number]: number | string; }
|
||||
>v : { [x: number]: string | number; }
|
||||
>{ get [0 + 1]() { return 0 }, set [0 + 1](v: string) { } //No error} : { [x: number]: string | number; }
|
||||
|
||||
get [0 + 1]() { return 0 },
|
||||
>0 + 1 : number
|
||||
|
||||
@@ -9,8 +9,8 @@ var a: any;
|
||||
>a : any
|
||||
|
||||
var v = {
|
||||
>v : { [x: string]: number | string; [x: number]: number | string; [0]: number; [""]: number; }
|
||||
>{ [s]: 0, [n]: n, [s + s]: 1, [s + n]: 2, [+s]: s, [""]: 0, [0]: 0, [a]: 1, [<any>true]: 0, [`hello bye`]: 0, [`hello ${a} bye`]: 0} : { [x: string]: number | string; [x: number]: number | string; [0]: number; [""]: number; }
|
||||
>v : { [x: string]: string | number; [x: number]: string | number; [0]: number; [""]: number; }
|
||||
>{ [s]: 0, [n]: n, [s + s]: 1, [s + n]: 2, [+s]: s, [""]: 0, [0]: 0, [a]: 1, [<any>true]: 0, [`hello bye`]: 0, [`hello ${a} bye`]: 0} : { [x: string]: string | number; [x: number]: string | number; [0]: number; [""]: number; }
|
||||
|
||||
[s]: 0,
|
||||
>s : string
|
||||
|
||||
@@ -9,8 +9,8 @@ var a: any;
|
||||
>a : any
|
||||
|
||||
var v = {
|
||||
>v : { [x: string]: number | string; [x: number]: number | string; [0]: number; [""]: number; }
|
||||
>{ [s]: 0, [n]: n, [s + s]: 1, [s + n]: 2, [+s]: s, [""]: 0, [0]: 0, [a]: 1, [<any>true]: 0, [`hello bye`]: 0, [`hello ${a} bye`]: 0} : { [x: string]: number | string; [x: number]: number | string; [0]: number; [""]: number; }
|
||||
>v : { [x: string]: string | number; [x: number]: string | number; [0]: number; [""]: number; }
|
||||
>{ [s]: 0, [n]: n, [s + s]: 1, [s + n]: 2, [+s]: s, [""]: 0, [0]: 0, [a]: 1, [<any>true]: 0, [`hello bye`]: 0, [`hello ${a} bye`]: 0} : { [x: string]: string | number; [x: number]: string | number; [0]: number; [""]: number; }
|
||||
|
||||
[s]: 0,
|
||||
>s : string
|
||||
|
||||
@@ -17,9 +17,9 @@ declare function foo<T>(obj: I<T>): T
|
||||
>T : T
|
||||
|
||||
foo({
|
||||
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | (() => void) | boolean | number | number[]
|
||||
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[]
|
||||
>foo : <T>(obj: I<T>) => T
|
||||
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | (() => void) | boolean | number | number[]; [x: number]: (() => void) | number | number[]; 0: () => void; p: string; }
|
||||
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | boolean | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; p: string; }
|
||||
|
||||
p: "",
|
||||
>p : string
|
||||
|
||||
@@ -17,9 +17,9 @@ declare function foo<T>(obj: I<T>): T
|
||||
>T : T
|
||||
|
||||
foo({
|
||||
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | (() => void) | boolean | number | number[]
|
||||
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[]
|
||||
>foo : <T>(obj: I<T>) => T
|
||||
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | (() => void) | boolean | number | number[]; [x: number]: (() => void) | number | number[]; 0: () => void; p: string; }
|
||||
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | boolean | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; p: string; }
|
||||
|
||||
p: "",
|
||||
>p : string
|
||||
|
||||
@@ -33,9 +33,9 @@ declare function g<T>(obj: J<T>): T;
|
||||
>T : T
|
||||
|
||||
foo({
|
||||
>foo({ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : (() => void) | number | number[]
|
||||
>foo({ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : number | (() => void) | number[]
|
||||
>foo : <T>(obj: I<T>) => T
|
||||
>{ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: (() => void) | boolean | number | number[]; [x: number]: (() => void) | number | number[]; 0: () => void; }
|
||||
>{ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: number | boolean | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; }
|
||||
|
||||
0: () => { },
|
||||
>() => { } : () => void
|
||||
|
||||
@@ -33,9 +33,9 @@ declare function g<T>(obj: J<T>): T;
|
||||
>T : T
|
||||
|
||||
foo({
|
||||
>foo({ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : (() => void) | number | number[]
|
||||
>foo({ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : number | (() => void) | number[]
|
||||
>foo : <T>(obj: I<T>) => T
|
||||
>{ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: (() => void) | boolean | number | number[]; [x: number]: (() => void) | number | number[]; 0: () => void; }
|
||||
>{ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: number | boolean | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; }
|
||||
|
||||
0: () => { },
|
||||
>() => { } : () => void
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2322: Type 'number | string' is not assignable to type 'boolean'.
|
||||
Type 'number' is not assignable to type 'boolean'.
|
||||
tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2322: Type 'string | number' is not assignable to type 'boolean'.
|
||||
Type 'string' is not assignable to type 'boolean'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/conditionalExpression1.ts (1 errors) ====
|
||||
var x: boolean = (true ? 1 : ""); // should be an error
|
||||
~
|
||||
!!! error TS2322: Type 'number | string' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'.
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
|
||||
@@ -122,7 +122,7 @@ typeof "123" == "string" ? exprBoolean1 : exprBoolean2;
|
||||
>typeof "123" == "string" : boolean
|
||||
>typeof "123" : string
|
||||
>"123" : string
|
||||
>"string" : string
|
||||
>"string" : "string"
|
||||
>exprBoolean1 : boolean
|
||||
>exprBoolean2 : boolean
|
||||
|
||||
@@ -264,7 +264,7 @@ var resultIsBoolean3 = typeof "123" == "string" ? exprBoolean1 : exprBoolean2;
|
||||
>typeof "123" == "string" : boolean
|
||||
>typeof "123" : string
|
||||
>"123" : string
|
||||
>"string" : string
|
||||
>"string" : "string"
|
||||
>exprBoolean1 : boolean
|
||||
>exprBoolean2 : boolean
|
||||
|
||||
@@ -301,7 +301,7 @@ var resultIsStringOrBoolean4 = typeof "123" === "string" ? exprString1 : exprBoo
|
||||
>typeof "123" === "string" : boolean
|
||||
>typeof "123" : string
|
||||
>"123" : string
|
||||
>"string" : string
|
||||
>"string" : "string"
|
||||
>exprString1 : string
|
||||
>exprBoolean1 : boolean
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2;
|
||||
//Expr1 and Expr2 are literals
|
||||
var result11: any = true ? 1 : 'string';
|
||||
>result11 : any
|
||||
>true ? 1 : 'string' : number | string
|
||||
>true ? 1 : 'string' : string | number
|
||||
>true : boolean
|
||||
>1 : number
|
||||
>'string' : string
|
||||
|
||||
@@ -337,24 +337,24 @@ function foo1(e: I1.C.E): void {
|
||||
if (e === I1.C.E.V1) {
|
||||
>e === I1.C.E.V1 : boolean
|
||||
>e : I1.C.E
|
||||
>I1.C.E.V1 : I1.C.E
|
||||
>I1.C.E.V1 : I1.C.E.V1
|
||||
>I1.C.E : typeof I1.C.E
|
||||
>I1.C : typeof I1.C
|
||||
>I1 : typeof I1
|
||||
>C : typeof I1.C
|
||||
>E : typeof I1.C.E
|
||||
>V1 : I1.C.E
|
||||
>V1 : I1.C.E.V1
|
||||
}
|
||||
else if (e === I1.C.E.V2) {
|
||||
>e === I1.C.E.V2 : boolean
|
||||
>e : I1.C.E
|
||||
>I1.C.E.V2 : I1.C.E
|
||||
>e : I1.C.E.V2
|
||||
>I1.C.E.V2 : I1.C.E.V2
|
||||
>I1.C.E : typeof I1.C.E
|
||||
>I1.C : typeof I1.C
|
||||
>I1 : typeof I1
|
||||
>C : typeof I1.C
|
||||
>E : typeof I1.C.E
|
||||
>V2 : I1.C.E
|
||||
>V2 : I1.C.E.V2
|
||||
}
|
||||
}
|
||||
|
||||
@@ -368,24 +368,24 @@ function foo2(e: I2.C.E): void {
|
||||
if (e === I2.C.E.V1) {
|
||||
>e === I2.C.E.V1 : boolean
|
||||
>e : I2.C.E
|
||||
>I2.C.E.V1 : I2.C.E
|
||||
>I2.C.E.V1 : I2.C.E.V1
|
||||
>I2.C.E : typeof I2.C.E
|
||||
>I2.C : typeof I2.C
|
||||
>I2 : typeof I2
|
||||
>C : typeof I2.C
|
||||
>E : typeof I2.C.E
|
||||
>V1 : I2.C.E
|
||||
>V1 : I2.C.E.V1
|
||||
}
|
||||
else if (e === I2.C.E.V2) {
|
||||
>e === I2.C.E.V2 : boolean
|
||||
>e : I2.C.E
|
||||
>I2.C.E.V2 : I2.C.E
|
||||
>e : I2.C.E.V2
|
||||
>I2.C.E.V2 : I2.C.E.V2
|
||||
>I2.C.E : typeof I2.C.E
|
||||
>I2.C : typeof I2.C
|
||||
>I2 : typeof I2
|
||||
>C : typeof I2.C
|
||||
>E : typeof I2.C.E
|
||||
>V2 : I2.C.E
|
||||
>V2 : I2.C.E.V2
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ function f1() {
|
||||
>typeof x === "string" : boolean
|
||||
>typeof x : string
|
||||
>x : string | number
|
||||
>"string" : string
|
||||
>"string" : "string"
|
||||
|
||||
const f = () => x.length;
|
||||
>f : () => number
|
||||
@@ -37,7 +37,7 @@ function f2() {
|
||||
>typeof x !== "string" : boolean
|
||||
>typeof x : string
|
||||
>x : string | number
|
||||
>"string" : string
|
||||
>"string" : "string"
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ function f3() {
|
||||
>typeof x === "string" : boolean
|
||||
>typeof x : string
|
||||
>x : string | number
|
||||
>"string" : string
|
||||
>"string" : "string"
|
||||
|
||||
const f = function() { return x.length; };
|
||||
>f : () => number
|
||||
@@ -84,7 +84,7 @@ function f4() {
|
||||
>typeof x !== "string" : boolean
|
||||
>typeof x : string
|
||||
>x : string | number
|
||||
>"string" : string
|
||||
>"string" : "string"
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ function f5() {
|
||||
>typeof x === "string" : boolean
|
||||
>typeof x : string
|
||||
>x : string | number
|
||||
>"string" : string
|
||||
>"string" : "string"
|
||||
|
||||
const f = () => () => x.length;
|
||||
>f : () => () => number
|
||||
|
||||
@@ -12,12 +12,12 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(32,18): error TS
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,26): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(35,28): error TS2304: Cannot find name 'bfs'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(36,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(36,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and '0'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(39,17): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,28): error TS2304: Cannot find name 'bfs'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,41): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,45): error TS1002: Unterminated string literal.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(42,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(42,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and '0'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(48,17): error TS2304: Cannot find name 'console'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(50,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(54,13): error TS2304: Cannot find name 'console'.
|
||||
@@ -38,6 +38,9 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(160,30): error T
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(160,31): error TS2304: Cannot find name 'Property'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(167,13): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(181,40): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(182,13): error TS2322: Type 'boolean' is not assignable to type 'number | true'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(184,13): error TS2322: Type 'boolean' is not assignable to type 'number | true'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(192,13): error TS2322: Type 'boolean' is not assignable to type 'number | true'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(206,28): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(214,16): error TS2304: Cannot find name 'bool'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(219,10): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
||||
@@ -83,7 +86,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(260,55): error T
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(262,1): error TS1128: Declaration or statement expected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (83 errors) ====
|
||||
==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (86 errors) ====
|
||||
|
||||
declare module "fs" {
|
||||
export class File {
|
||||
@@ -152,7 +155,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(262,1): error TS
|
||||
!!! error TS2304: Cannot find name 'bfs'.
|
||||
if (retValue != 0) {
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'.
|
||||
!!! error TS2365: Operator '!=' cannot be applied to types 'boolean' and '0'.
|
||||
|
||||
return 1 &&
|
||||
}
|
||||
@@ -168,7 +171,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(262,1): error TS
|
||||
!!! error TS1002: Unterminated string literal.
|
||||
if (retValue != 0) {
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2365: Operator '!=' cannot be applied to types 'boolean' and 'number'.
|
||||
!!! error TS2365: Operator '!=' cannot be applied to types 'boolean' and '0'.
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -349,8 +352,12 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(262,1): error TS
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
b = !b;/*!*/
|
||||
~
|
||||
!!! error TS2322: Type 'boolean' is not assignable to type 'number | true'.
|
||||
i = ~i;/*~i*/
|
||||
b = i < (i - 1) && (i + 1) > i;/*< && >*/
|
||||
~
|
||||
!!! error TS2322: Type 'boolean' is not assignable to type 'number | true'.
|
||||
var f = true ? 1 : 0;/*? :*/ // YES :
|
||||
i++;/*++*/
|
||||
i--;/*--*/
|
||||
@@ -359,6 +366,8 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(262,1): error TS
|
||||
i = i >> 5;/*>>*/
|
||||
var j = i;
|
||||
b = i == j && i != j && i <= j && i >= j;/*= == && != <= >=*/
|
||||
~
|
||||
!!! error TS2322: Type 'boolean' is not assignable to type 'number | true'.
|
||||
i += <number>5.0;/*+=*/
|
||||
i -= i;/*-=*/
|
||||
i *= i;/**=*/
|
||||
|
||||
@@ -87,24 +87,24 @@ var a = baz(1, 1, g); // Should be number
|
||||
>g : <T>(x: T, y: T) => T
|
||||
|
||||
var b: number | string;
|
||||
>b : number | string
|
||||
>b : string | number
|
||||
|
||||
var b = foo(g); // Should be number | string
|
||||
>b : number | string
|
||||
>foo(g) : number | string
|
||||
>b : string | number
|
||||
>foo(g) : string | number
|
||||
>foo : <T>(cb: (x: number, y: string) => T) => T
|
||||
>g : <T>(x: T, y: T) => T
|
||||
|
||||
var b = bar(1, "one", g); // Should be number | string
|
||||
>b : number | string
|
||||
>bar(1, "one", g) : number | string
|
||||
>b : string | number
|
||||
>bar(1, "one", g) : string | number
|
||||
>bar : <T, U, V>(x: T, y: U, cb: (x: T, y: U) => V) => V
|
||||
>1 : number
|
||||
>"one" : string
|
||||
>g : <T>(x: T, y: T) => T
|
||||
|
||||
var b = bar("one", 1, g); // Should be number | string
|
||||
>b : number | string
|
||||
>b : string | number
|
||||
>bar("one", 1, g) : string | number
|
||||
>bar : <T, U, V>(x: T, y: U, cb: (x: T, y: U) => V) => V
|
||||
>"one" : string
|
||||
@@ -112,11 +112,11 @@ var b = bar("one", 1, g); // Should be number | string
|
||||
>g : <T>(x: T, y: T) => T
|
||||
|
||||
var b = baz(b, b, g); // Should be number | string
|
||||
>b : number | string
|
||||
>baz(b, b, g) : number | string
|
||||
>b : string | number
|
||||
>baz(b, b, g) : string | number
|
||||
>baz : <T, U>(x: T, y: T, cb: (x: T, y: T) => U) => U
|
||||
>b : number | string
|
||||
>b : number | string
|
||||
>b : string | number
|
||||
>b : string | number
|
||||
>g : <T>(x: T, y: T) => T
|
||||
|
||||
var d: number[] | string[];
|
||||
@@ -138,7 +138,7 @@ var d = bar(1, "one", h); // Should be number[] | string[]
|
||||
|
||||
var d = bar("one", 1, h); // Should be number[] | string[]
|
||||
>d : number[] | string[]
|
||||
>bar("one", 1, h) : string[] | number[]
|
||||
>bar("one", 1, h) : number[] | string[]
|
||||
>bar : <T, U, V>(x: T, y: U, cb: (x: T, y: U) => V) => V
|
||||
>"one" : string
|
||||
>1 : number
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(3,5): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'.
|
||||
Types of property 'pop' are incompatible.
|
||||
Type '() => number | string | boolean' is not assignable to type '() => number | string'.
|
||||
Type 'number | string | boolean' is not assignable to type 'number | string'.
|
||||
Type 'boolean' is not assignable to type 'number | string'.
|
||||
Type '() => string | number | boolean' is not assignable to type '() => string | number'.
|
||||
Type 'string | number | boolean' is not assignable to type 'string | number'.
|
||||
Type 'true' is not assignable to type 'string | number'.
|
||||
tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(15,1): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'.
|
||||
tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(18,1): error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'.
|
||||
Types of property '0' are incompatible.
|
||||
@@ -30,9 +30,9 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(25,1): error TS23
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'.
|
||||
!!! error TS2322: Types of property 'pop' are incompatible.
|
||||
!!! error TS2322: Type '() => number | string | boolean' is not assignable to type '() => number | string'.
|
||||
!!! error TS2322: Type 'number | string | boolean' is not assignable to type 'number | string'.
|
||||
!!! error TS2322: Type 'boolean' is not assignable to type 'number | string'.
|
||||
!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => string | number'.
|
||||
!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number'.
|
||||
!!! error TS2322: Type 'true' is not assignable to type 'string | number'.
|
||||
var numStrBoolTuple: [number, string, boolean] = [5, "foo", true];
|
||||
var objNumTuple: [{ a: string }, number] = [{ a: "world" }, 5];
|
||||
var strTupleTuple: [string, [number, {}]] = ["bar", [5, { x: 1, y: 1 }]];
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '({ id: number; } | number)[]' is not assignable to type '{ id: number; }[]'.
|
||||
Type '{ id: number; } | number' is not assignable to type '{ id: number; }'.
|
||||
tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'.
|
||||
Type 'number | { id: number; }' is not assignable to type '{ id: number; }'.
|
||||
Type 'number' is not assignable to type '{ id: number; }'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/contextualTyping21.ts (1 errors) ====
|
||||
var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, 1];
|
||||
~~~
|
||||
!!! error TS2322: Type '({ id: number; } | number)[]' is not assignable to type '{ id: number; }[]'.
|
||||
!!! error TS2322: Type '{ id: number; } | number' is not assignable to type '{ id: number; }'.
|
||||
!!! error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'.
|
||||
!!! error TS2322: Type 'number | { id: number; }' is not assignable to type '{ id: number; }'.
|
||||
!!! error TS2322: Type 'number' is not assignable to type '{ id: number; }'.
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/compiler/contextualTyping30.ts(1,37): error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'number[]'.
|
||||
Type 'number | string' is not assignable to type 'number'.
|
||||
tests/cases/compiler/contextualTyping30.ts(1,37): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'.
|
||||
Type 'string | number' is not assignable to type 'number'.
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/contextualTyping30.ts (1 errors) ====
|
||||
function foo(param:number[]){}; foo([1, "a"]);
|
||||
~~~~~~~~
|
||||
!!! error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'number[]'.
|
||||
!!! error TS2345: Type 'number | string' is not assignable to type 'number'.
|
||||
!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'.
|
||||
!!! error TS2345: Type 'string | number' is not assignable to type 'number'.
|
||||
!!! error TS2345: Type 'string' is not assignable to type 'number'.
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Type '(Date | number)[]' is not assignable to type 'I'.
|
||||
tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Type '(number | Date)[]' is not assignable to type 'I'.
|
||||
Index signatures are incompatible.
|
||||
Type 'Date | number' is not assignable to type 'Date'.
|
||||
Type 'number | Date' is not assignable to type 'Date'.
|
||||
Type 'number' is not assignable to type 'Date'.
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Typ
|
||||
|
||||
var x3: I = [new Date(), 1];
|
||||
~~
|
||||
!!! error TS2322: Type '(Date | number)[]' is not assignable to type 'I'.
|
||||
!!! error TS2322: Type '(number | Date)[]' is not assignable to type 'I'.
|
||||
!!! error TS2322: Index signatures are incompatible.
|
||||
!!! error TS2322: Type 'Date | number' is not assignable to type 'Date'.
|
||||
!!! error TS2322: Type 'number | Date' is not assignable to type 'Date'.
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'Date'.
|
||||
var r2 = x3[1];
|
||||
r2.getDate();
|
||||
|
||||
@@ -119,18 +119,18 @@
|
||||
|
||||
((...mixed) => mixed.every(n => !!n))(5,'oops','oh no');
|
||||
>((...mixed) => mixed.every(n => !!n))(5,'oops','oh no') : boolean
|
||||
>((...mixed) => mixed.every(n => !!n)) : (...mixed: (number | string)[]) => boolean
|
||||
>(...mixed) => mixed.every(n => !!n) : (...mixed: (number | string)[]) => boolean
|
||||
>mixed : (number | string)[]
|
||||
>((...mixed) => mixed.every(n => !!n)) : (...mixed: (string | number)[]) => boolean
|
||||
>(...mixed) => mixed.every(n => !!n) : (...mixed: (string | number)[]) => boolean
|
||||
>mixed : (string | number)[]
|
||||
>mixed.every(n => !!n) : boolean
|
||||
>mixed.every : (callbackfn: (value: number | string, index: number, array: (number | string)[]) => boolean, thisArg?: any) => boolean
|
||||
>mixed : (number | string)[]
|
||||
>every : (callbackfn: (value: number | string, index: number, array: (number | string)[]) => boolean, thisArg?: any) => boolean
|
||||
>n => !!n : (n: number | string) => boolean
|
||||
>n : number | string
|
||||
>mixed.every : (callbackfn: (value: string | number, index: number, array: (string | number)[]) => boolean, thisArg?: any) => boolean
|
||||
>mixed : (string | number)[]
|
||||
>every : (callbackfn: (value: string | number, index: number, array: (string | number)[]) => boolean, thisArg?: any) => boolean
|
||||
>n => !!n : (n: string | number) => boolean
|
||||
>n : string | number
|
||||
>!!n : boolean
|
||||
>!n : boolean
|
||||
>n : number | string
|
||||
>n : string | number
|
||||
>5 : number
|
||||
>'oops' : string
|
||||
>'oh no' : string
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user