From a179dc7eaeb4195afe2cc5905648476319814836 Mon Sep 17 00:00:00 2001 From: hufeng Date: Thu, 8 Sep 2022 16:16:16 +0800 Subject: [PATCH 01/28] Adapt to merge sourceMaps Issue: https://gitee.com/openharmony/developtools_ace-ets2bundle/issues/I5QAA2?from=project-issue Signed-off-by: hufeng Change-Id: If78d39cfc898af9f5c337b6750c4df84c4c15806 --- es2panda/aot/options.cpp | 4 +++- es2panda/compiler/core/emitter/emitter.cpp | 6 +++--- es2panda/es2panda.cpp | 4 +++- es2panda/es2panda.h | 1 + 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/es2panda/aot/options.cpp b/es2panda/aot/options.cpp index 7d56cfb73c..d3acf5dcf4 100644 --- a/es2panda/aot/options.cpp +++ b/es2panda/aot/options.cpp @@ -71,7 +71,7 @@ bool Options::CollectInputFilesFromFileList(const std::string &input) return false; } - constexpr size_t ITEM_COUNT = 3; + constexpr size_t ITEM_COUNT = 4; while (std::getline(ifs, line)) { const std::string seperator = ";"; std::vector itemList = GetStringItems(line, seperator); @@ -79,6 +79,7 @@ bool Options::CollectInputFilesFromFileList(const std::string &input) std::cerr << "Failed to parse input file" << std::endl; return false; } + // itemList: [filePath, recordName, moduleKind, sourceFile] std::string fileName = itemList[0]; std::string recordName = FormatRecordName(itemList[1]); parser::ScriptKind scriptKind; @@ -91,6 +92,7 @@ bool Options::CollectInputFilesFromFileList(const std::string &input) } es2panda::SourceFile src(fileName, recordName, scriptKind); + src.sourcefile = itemList[3]; sourceFiles_.push_back(src); } return true; diff --git a/es2panda/compiler/core/emitter/emitter.cpp b/es2panda/compiler/core/emitter/emitter.cpp index 53064fdc1d..7006d4478e 100644 --- a/es2panda/compiler/core/emitter/emitter.cpp +++ b/es2panda/compiler/core/emitter/emitter.cpp @@ -274,10 +274,10 @@ void FunctionEmitter::GenLiteralBuffers() void FunctionEmitter::GenSourceFileDebugInfo() { - if (pg_->SourceFile().size() > 0) { - func_->source_file = pg_->SourceFile(); - } else { + if (pg_->SourceFile().empty()) { func_->source_file = std::string {pg_->Binder()->Program()->SourceFile()}; + } else { + func_->source_file = pg_->SourceFile(); } if (!pg_->IsDebug()) { diff --git a/es2panda/es2panda.cpp b/es2panda/es2panda.cpp index fcb7f8208a..a87da3ed75 100644 --- a/es2panda/es2panda.cpp +++ b/es2panda/es2panda.cpp @@ -53,6 +53,7 @@ panda::pandasm::Program *Compiler::Compile(const SourceFile &input, const Compil std::string fname(input.fileName); std::string src(input.source); std::string rname(input.recordName); + std::string sourcefile(input.sourcefile); parser::ScriptKind kind(input.scriptKind); bool needDumpSymbolFile = !options.hotfixOptions.dumpSymbolTable.empty(); @@ -71,7 +72,8 @@ panda::pandasm::Program *Compiler::Compile(const SourceFile &input, const Compil std::cout << ast.Dump() << std::endl; } - std::string debugInfoSourceFile = options.debugInfoSourceFile.empty() ? fname : options.debugInfoSourceFile; + std::string debugInfoSourceFile = options.debugInfoSourceFile.empty() ? + sourcefile : options.debugInfoSourceFile; auto *prog = compiler_->Compile(&ast, options, debugInfoSourceFile); if (hotfixHelper) { diff --git a/es2panda/es2panda.h b/es2panda/es2panda.h index dc0e9480ee..72b7c4394a 100644 --- a/es2panda/es2panda.h +++ b/es2panda/es2panda.h @@ -54,6 +54,7 @@ struct SourceFile { std::string recordName {}; std::string_view source {}; parser::ScriptKind scriptKind {}; + std::string sourcefile {}; uint32_t hash {0}; }; -- Gitee From 34a4f20510dccec79b9f7d8f62d0a8cbaa6f8cc8 Mon Sep 17 00:00:00 2001 From: gavin1012_hw Date: Tue, 13 Sep 2022 15:39:38 +0800 Subject: [PATCH 02/28] Modify the introduction in ReadMe file Signed-off-by: gavin1012_hw Change-Id: Ib48dbcab78a984b5c0da53a2ac126e46b10b18a3 --- README.md | 2 +- README_zh.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0c894ee386..4815374f44 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ## Introduction -ets_frontend is a front-end tool in the ARK Runtime Subsystem. It converts JavaScript(JS) files into ARK bytecode files. +ets_frontend is a front-end tool in the ARK Runtime Subsystem. Combined with the ace-ets2bundle component, it supports converting ETS files into ARK bytecode files. For more information, see: [ARK Runtime Subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/ARK-Runtime-Subsystem.md). diff --git a/README_zh.md b/README_zh.md index 5966da7972..7f78b6595b 100644 --- a/README_zh.md +++ b/README_zh.md @@ -9,7 +9,7 @@ ## 简介 -ets_frontend组件是方舟运行时子系统的前端工具,支持将JavaScript文件转换为方舟字节码文件。 +ets_frontend组件是方舟运行时子系统的前端工具,结合ace-ets2bundle组件,支持将ets文件转换为方舟字节码文件。 更多信息请参考:[方舟运行时子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/ARK-Runtime-Subsystem-zh.md) -- Gitee From 750a125aeb37a0a6eaa9c430f531423ed7eed6cf Mon Sep 17 00:00:00 2001 From: zhangchen168 Date: Tue, 13 Sep 2022 10:25:21 +0800 Subject: [PATCH 03/28] Fix identifier comparison of interface methodsignatures Enable the same method signature identifier in the interface Add a test case and expectation: es2panda/test/parser/ts/test-interface-method-identifier1.ts es2panda/test/parser/ts/test-interface-method-identifier1-expected.txt Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I5Q942 Test: test262,parser tests Signed-off-by: zhangchen168 Change-Id: I16d86fd49117d0f71a81ed9913a83d3cbedaa5f2 --- es2panda/parser/parserImpl.cpp | 22 +- es2panda/parser/parserImpl.h | 2 +- ...-interface-method-identifier1-expected.txt | 700 ++++++++++++++++++ .../ts/test-interface-method-identifier1.ts | 21 + 4 files changed, 738 insertions(+), 7 deletions(-) create mode 100644 es2panda/test/parser/ts/test-interface-method-identifier1-expected.txt create mode 100644 es2panda/test/parser/ts/test-interface-method-identifier1.ts diff --git a/es2panda/parser/parserImpl.cpp b/es2panda/parser/parserImpl.cpp index d3039e2a13..3f089b240a 100644 --- a/es2panda/parser/parserImpl.cpp +++ b/es2panda/parser/parserImpl.cpp @@ -1357,8 +1357,18 @@ util::StringView GetTSPropertyName(ir::Expression *key) } } -void ParserImpl::CheckObjectTypeForDuplicatedProperties(ir::Expression *key, ArenaVector &members) +void ParserImpl::CheckObjectTypeForDuplicatedProperties(ir::Expression *member, ArenaVector &members) { + ir::Expression *key = nullptr; + + if (member->IsTSPropertySignature()) { + key = member->AsTSPropertySignature()->Key(); + } else if (member->IsTSMethodSignature()) { + key = member->AsTSMethodSignature()->Key(); + } else { + return; + } + if (!key->IsIdentifier() && !key->IsNumberLiteral() && !key->IsStringLiteral()) { return; } @@ -1384,6 +1394,10 @@ void ParserImpl::CheckObjectTypeForDuplicatedProperties(ir::Expression *key, Are continue; } + if (member->IsTSMethodSignature() && it->Type() == ir::AstNodeType::TS_METHOD_SIGNATURE) { + continue; + } + if (GetTSPropertyName(key) == GetTSPropertyName(compare)) { ThrowSyntaxError("Duplicated identifier", key->Start()); } @@ -1401,11 +1415,7 @@ ArenaVector ParserImpl::ParseTsTypeLiteralOrInterface() while (lexer_->GetToken().Type() != lexer::TokenType::PUNCTUATOR_RIGHT_BRACE) { ir::Expression *member = ParseTsTypeLiteralOrInterfaceMember(); - if (member->IsTSPropertySignature()) { - CheckObjectTypeForDuplicatedProperties(member->AsTSPropertySignature()->Key(), members); - } else if (member->IsTSMethodSignature()) { - CheckObjectTypeForDuplicatedProperties(member->AsTSMethodSignature()->Key(), members); - } + CheckObjectTypeForDuplicatedProperties(member, members); members.push_back(member); diff --git a/es2panda/parser/parserImpl.h b/es2panda/parser/parserImpl.h index ed541f881c..2755b19e90 100644 --- a/es2panda/parser/parserImpl.h +++ b/es2panda/parser/parserImpl.h @@ -324,7 +324,7 @@ private: ir::TSParameterProperty *CreateTsParameterProperty(ir::Expression *parameter, ir::ModifierFlags modifiers); ir::Expression *ParseFunctionParameter(bool isDeclare); void CreateTSVariableForProperty(ir::AstNode *node, const ir::Expression *key, binder::VariableFlags flags); - void CheckObjectTypeForDuplicatedProperties(ir::Expression *key, ArenaVector &members); + void CheckObjectTypeForDuplicatedProperties(ir::Expression *member, ArenaVector &members); // ExpressionParser.Cpp diff --git a/es2panda/test/parser/ts/test-interface-method-identifier1-expected.txt b/es2panda/test/parser/ts/test-interface-method-identifier1-expected.txt new file mode 100644 index 0000000000..dae1cab055 --- /dev/null +++ b/es2panda/test/parser/ts/test-interface-method-identifier1-expected.txt @@ -0,0 +1,700 @@ +{ + "type": "Program", + "statements": [ + { + "type": "TSInterfaceDeclaration", + "body": { + "type": "TSInterfaceBody", + "body": [ + { + "type": "TSMethodSignature", + "computed": false, + "optional": false, + "key": { + "type": "Identifier", + "name": "then", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "success", + "typeAnnotation": { + "type": "TSFunctionType", + "params": [ + { + "type": "Identifier", + "name": "value", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "T", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 32 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 32 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 24 + }, + "end": { + "line": 18, + "column": 29 + } + } + } + ], + "returnType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "U", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 37 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 37 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 23 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "optional": true, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + } + ], + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "params": [ + { + "type": "TSTypeParameter", + "name": { + "type": "Identifier", + "name": "U", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 10 + }, + "end": { + "line": 18, + "column": 11 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 10 + }, + "end": { + "line": 18, + "column": 12 + } + } + } + ], + "loc": { + "start": { + "line": 18, + "column": 9 + }, + "end": { + "line": 18, + "column": 12 + } + } + }, + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Promise", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 41 + }, + "end": { + "line": 18, + "column": 48 + } + } + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "params": [ + { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "U", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 49 + }, + "end": { + "line": 18, + "column": 50 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 49 + }, + "end": { + "line": 18, + "column": 50 + } + } + } + ], + "loc": { + "start": { + "line": 18, + "column": 41 + }, + "end": { + "line": 18, + "column": 51 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 41 + }, + "end": { + "line": 18, + "column": 48 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 52 + } + } + }, + { + "type": "TSMethodSignature", + "computed": false, + "optional": false, + "key": { + "type": "Identifier", + "name": "then", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 9 + } + } + }, + "params": [ + { + "type": "Identifier", + "name": "success", + "typeAnnotation": { + "type": "TSFunctionType", + "params": [ + { + "type": "Identifier", + "name": "value", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "T", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 31 + }, + "end": { + "line": 19, + "column": 32 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 31 + }, + "end": { + "line": 19, + "column": 32 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 24 + }, + "end": { + "line": 19, + "column": 29 + } + } + } + ], + "returnType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Promise", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 37 + }, + "end": { + "line": 19, + "column": 44 + } + } + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "params": [ + { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "U", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 45 + }, + "end": { + "line": 19, + "column": 46 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 45 + }, + "end": { + "line": 19, + "column": 46 + } + } + } + ], + "loc": { + "start": { + "line": 19, + "column": 37 + }, + "end": { + "line": 19, + "column": 47 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 37 + }, + "end": { + "line": 19, + "column": 44 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 23 + }, + "end": { + "line": 19, + "column": 44 + } + } + }, + "optional": true, + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 13 + }, + "end": { + "line": 19, + "column": 20 + } + } + } + ], + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "params": [ + { + "type": "TSTypeParameter", + "name": { + "type": "Identifier", + "name": "U", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 10 + }, + "end": { + "line": 19, + "column": 11 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 10 + }, + "end": { + "line": 19, + "column": 12 + } + } + } + ], + "loc": { + "start": { + "line": 19, + "column": 9 + }, + "end": { + "line": 19, + "column": 12 + } + } + }, + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Promise", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 50 + }, + "end": { + "line": 19, + "column": 57 + } + } + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "params": [ + { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "U", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 58 + }, + "end": { + "line": 19, + "column": 59 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 58 + }, + "end": { + "line": 19, + "column": 59 + } + } + } + ], + "loc": { + "start": { + "line": 19, + "column": 50 + }, + "end": { + "line": 19, + "column": 60 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 50 + }, + "end": { + "line": 19, + "column": 57 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 61 + } + } + }, + { + "type": "TSPropertySignature", + "computed": false, + "optional": false, + "readonly": false, + "key": { + "type": "Identifier", + "name": "value", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 10 + } + } + }, + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "T", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 12 + }, + "end": { + "line": 20, + "column": 13 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 12 + }, + "end": { + "line": 20, + "column": 13 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 14 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 22 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "id": { + "type": "Identifier", + "name": "Promise", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 11 + }, + "end": { + "line": 17, + "column": 18 + } + } + }, + "extends": [], + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "params": [ + { + "type": "TSTypeParameter", + "name": { + "type": "Identifier", + "name": "T", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 19 + }, + "end": { + "line": 17, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 17, + "column": 19 + }, + "end": { + "line": 17, + "column": 21 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 18 + }, + "end": { + "line": 17, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 21, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 22, + "column": 1 + } + } +} diff --git a/es2panda/test/parser/ts/test-interface-method-identifier1.ts b/es2panda/test/parser/ts/test-interface-method-identifier1.ts new file mode 100644 index 0000000000..d00de1478a --- /dev/null +++ b/es2panda/test/parser/ts/test-interface-method-identifier1.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +interface Promise { + then(success?: (value: T) => U): Promise; + then(success?: (value: T) => Promise): Promise; + value: T; +} -- Gitee From c8c8f047917639d6efd0f9bf1600dc11b9086145 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Tue, 13 Sep 2022 20:41:10 +0800 Subject: [PATCH 04/28] Implement version and min version of es2abc Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I5QW2W?from=project-issue tests: test262,parser tests, compiler tests, tsc tests Signed-off-by: zhangrengao Change-Id: I43b73e045a0b50c58b441b3d44adf5b0af337741 --- es2panda/aot/main.cpp | 8 ++++++++ es2panda/aot/options.cpp | 18 ++++++++++++++++-- es2panda/es2panda.h | 2 ++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/es2panda/aot/main.cpp b/es2panda/aot/main.cpp index 2da57c1bb0..6b0f618d48 100644 --- a/es2panda/aot/main.cpp +++ b/es2panda/aot/main.cpp @@ -141,6 +141,14 @@ int Run(int argc, const char **argv) return 1; } + if (options->CompilerOptions().bcVersion || options->CompilerOptions().bcMinVersion) { + std::string version = options->CompilerOptions().bcVersion ? + panda::panda_file::GetVersion(panda::panda_file::version) : + panda::panda_file::GetVersion(panda::panda_file::minVersion); + std::cout << version << std::endl; + return 0; + } + std::map programsInfo; size_t expectedProgsCount = options->CompilerOptions().sourceFiles.size(); panda::ArenaAllocator allocator(panda::SpaceType::SPACE_TYPE_COMPILER, nullptr, true); diff --git a/es2panda/aot/options.cpp b/es2panda/aot/options.cpp index 7d56cfb73c..10410d9491 100644 --- a/es2panda/aot/options.cpp +++ b/es2panda/aot/options.cpp @@ -158,6 +158,10 @@ bool Options::Parse(int argc, const char **argv) panda::PandArg opInputSymbolTable("input-symbol-table", "", "input symbol table file"); panda::PandArg opGeneratePatch("generate-patch", false, "generate patch abc"); + // version + panda::PandArg bcVersion("bc-version", false, "Print ark bytecode version"); + panda::PandArg bcMinVersion("bc-min-version", false, "Print ark bytecode minimum supported version"); + // tail arguments panda::PandArg inputFile("input", "", "input file"); @@ -193,12 +197,22 @@ bool Options::Parse(int argc, const char **argv) argparser_->Add(&opInputSymbolTable); argparser_->Add(&opGeneratePatch); + argparser_->Add(&bcVersion); + argparser_->Add(&bcMinVersion); + argparser_->PushBackTail(&inputFile); argparser_->EnableTail(); argparser_->EnableRemainder(); - if (!argparser_->Parse(argc, argv) || opHelp.GetValue() || (inputFile.GetValue().empty() - && base64Input.GetValue().empty())) { + bool parseStatus = argparser_->Parse(argc, argv); + + if (parseStatus && (bcVersion.GetValue() || bcMinVersion.GetValue())) { + compilerOptions_.bcVersion = bcVersion.GetValue(); + compilerOptions_.bcMinVersion = bcMinVersion.GetValue(); + return true; + } + + if (!parseStatus || opHelp.GetValue() || (inputFile.GetValue().empty() && base64Input.GetValue().empty())) { std::stringstream ss; ss << argparser_->GetErrorString() << std::endl; diff --git a/es2panda/es2panda.h b/es2panda/es2panda.h index c6144e2e6f..ef72517fc3 100644 --- a/es2panda/es2panda.h +++ b/es2panda/es2panda.h @@ -81,6 +81,8 @@ struct CompilerOptions { std::string debugInfoSourceFile {}; std::vector sourceFiles; HotfixOptions hotfixOptions; + bool bcVersion {false}; + bool bcMinVersion {false}; }; enum class ErrorType { -- Gitee From 812b381f9cad7ad7426dffb795813d5cdb234b01 Mon Sep 17 00:00:00 2001 From: xucheng46 Date: Tue, 19 Jul 2022 17:41:04 +0800 Subject: [PATCH 05/28] Enable symbol and some other ts features in es2abc parser 1. Enable symbol and unique symbol type 2. Enable optional members, rest elements and variadic tuple in tuple type 3. Fix the issue in enum with shifting on enum members 4. Enalbe key remapping via as Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I5JXH3 Test: test262, parser tests, compiler tests Signed-off-by: xucheng46 Change-Id: I57d28402151ac40fce7dbe23f0e9782b76eb1e6f --- es2panda/BUILD.gn | 4 + es2panda/CMakeLists.txt | 4 + es2panda/ir/astNodeMapping.h | 3 + es2panda/ir/ts/tsMappedType.cpp | 1 + es2panda/ir/ts/tsMappedType.h | 6 +- es2panda/ir/ts/tsNamedTupleMember.cpp | 3 +- es2panda/ir/ts/tsNamedTupleMember.h | 11 +- es2panda/ir/ts/tsOptionalType.cpp | 53 + es2panda/ir/ts/tsOptionalType.h | 40 + es2panda/ir/ts/tsRestType.cpp | 53 + es2panda/ir/ts/tsRestType.h | 40 + es2panda/ir/ts/tsSymbolKeyword.cpp | 43 + es2panda/ir/ts/tsSymbolKeyword.h | 37 + es2panda/lexer/scripts/keywords.rb | 2 + es2panda/lexer/token/tokenType.h | 2 + es2panda/parser/expressionParser.cpp | 12 +- es2panda/parser/parserImpl.cpp | 131 +- es2panda/parser/parserImpl.h | 1 + .../ts/test-enum-declaration6-expected.txt | 374 ++++ .../test/parser/ts/test-enum-declaration6.ts | 23 + .../parser/ts/test-func-param-expected.txt | 12 +- .../test-ts-key-remapping-via-as-expected.txt | 900 +++++++++ .../parser/ts/test-ts-key-remapping-via-as.ts | 23 + .../ts/test-ts-symbol-type-expected.txt | 268 +++ .../test/parser/ts/test-ts-symbol-type.ts | 21 + .../test-ts-unique-symbol-type-expected.txt | 363 ++++ .../parser/ts/test-ts-unique-symbol-type.ts | 21 + .../parser/ts/test-tuple-type-expected.txt | 42 +- .../parser/ts/test-tuple-type2-expected.txt | 2 +- .../parser/ts/test-tuple-type5-expected.txt | 1691 +++++++++++++++++ es2panda/test/parser/ts/test-tuple-type5.ts | 32 + .../test/parser/ts/test_generic-expected.txt | 46 +- .../parser/ts/test_import_type-expected.txt | 4 +- .../parser/ts/test_this_type-expected.txt | 4 +- .../arrayDestructuring-expected.txt | 40 +- .../arrayDestructuring12-expected.txt | 6 +- .../arrayDestructuring13-expected.txt | 6 +- .../arrayDestructuring15-expected.txt | 2 +- .../arrayDestructuring16-expected.txt | 2 +- .../arrayDestructuring17-expected.txt | 4 +- .../arrayDestructuring18-expected.txt | 10 +- .../arrayDestructuring19-expected.txt | 10 +- .../arrayDestructuring27-expected.txt | 4 +- .../arrayDestructuring4-expected.txt | 4 +- .../arrayDestructuring5-expected.txt | 4 +- .../arrayDestructuring6-expected.txt | 4 +- .../functionOverload2-expected.txt | 16 +- .../interfaceAssignment-expected.txt | 4 +- .../interfaceAssignment3-expected.txt | 4 +- .../type_checker/memberExpTests-expected.txt | 6 +- .../objectDestructuring23-expected.txt | 4 +- .../objectDestructuring24-expected.txt | 4 +- .../objectDestructuring25-expected.txt | 4 +- .../objectLiteralAssignability-expected.txt | 6 +- .../test-type-literal-expected.txt | 2 +- .../tupleAssignability-expected.txt | 156 +- .../tupleAssignability10-expected.txt | 4 +- .../tupleAssignability11-expected.txt | 2 +- .../tupleAssignability12-expected.txt | 14 +- .../tupleAssignability13-expected.txt | 6 +- .../tupleAssignability15-expected.txt | 6 +- .../tupleAssignability16-expected.txt | 4 +- .../tupleAssignability17-expected.txt | 10 +- .../tupleAssignability18-expected.txt | 20 +- .../tupleAssignability19-expected.txt | 4 +- .../tupleAssignability2-expected.txt | 4 +- .../tupleAssignability20-expected.txt | 4 +- .../tupleAssignability21-expected.txt | 10 +- .../tupleAssignability22-expected.txt | 4 +- .../tupleAssignability23-expected.txt | 12 +- .../tupleAssignability24-expected.txt | 14 +- .../tupleAssignability3-expected.txt | 6 +- .../tupleAssignability4-expected.txt | 8 +- .../tupleAssignability5-expected.txt | 4 +- .../tupleAssignability6-expected.txt | 12 +- .../tupleAssignability7-expected.txt | 12 +- .../tupleAssignability8-expected.txt | 10 +- .../tupleAssignability9-expected.txt | 8 +- .../typeAliasUsedAsValue-expected.txt | 6 +- .../varRedeclaration-expected.txt | 24 +- .../varRedeclaration6-expected.txt | 12 +- es2panda/typescript/checker.h | 5 + .../typescript/types/globalTypesHolder.cpp | 9 +- es2panda/typescript/types/globalTypesHolder.h | 2 + es2panda/typescript/types/symbolType.cpp | 50 + es2panda/typescript/types/symbolType.h | 36 + es2panda/typescript/types/typeFacts.h | 7 + es2panda/typescript/types/typeMapping.h | 1 + es2panda/typescript/types/types.h | 1 + 89 files changed, 4545 insertions(+), 360 deletions(-) create mode 100644 es2panda/ir/ts/tsOptionalType.cpp create mode 100644 es2panda/ir/ts/tsOptionalType.h create mode 100644 es2panda/ir/ts/tsRestType.cpp create mode 100644 es2panda/ir/ts/tsRestType.h create mode 100644 es2panda/ir/ts/tsSymbolKeyword.cpp create mode 100644 es2panda/ir/ts/tsSymbolKeyword.h create mode 100644 es2panda/test/parser/ts/test-enum-declaration6-expected.txt create mode 100644 es2panda/test/parser/ts/test-enum-declaration6.ts create mode 100644 es2panda/test/parser/ts/test-ts-key-remapping-via-as-expected.txt create mode 100644 es2panda/test/parser/ts/test-ts-key-remapping-via-as.ts create mode 100644 es2panda/test/parser/ts/test-ts-symbol-type-expected.txt create mode 100644 es2panda/test/parser/ts/test-ts-symbol-type.ts create mode 100644 es2panda/test/parser/ts/test-ts-unique-symbol-type-expected.txt create mode 100644 es2panda/test/parser/ts/test-ts-unique-symbol-type.ts create mode 100644 es2panda/test/parser/ts/test-tuple-type5-expected.txt create mode 100644 es2panda/test/parser/ts/test-tuple-type5.ts create mode 100644 es2panda/typescript/types/symbolType.cpp create mode 100644 es2panda/typescript/types/symbolType.h diff --git a/es2panda/BUILD.gn b/es2panda/BUILD.gn index 17dff9d9cd..847457188e 100644 --- a/es2panda/BUILD.gn +++ b/es2panda/BUILD.gn @@ -157,13 +157,16 @@ es2panda_src = [ "ir/ts/tsNullKeyword.cpp", "ir/ts/tsNumberKeyword.cpp", "ir/ts/tsObjectKeyword.cpp", + "ir/ts/tsOptionalType.cpp", "ir/ts/tsParameterProperty.cpp", "ir/ts/tsParenthesizedType.cpp", "ir/ts/tsPrivateIdentifier.cpp", "ir/ts/tsPropertySignature.cpp", "ir/ts/tsQualifiedName.cpp", + "ir/ts/tsRestType.cpp", "ir/ts/tsSignatureDeclaration.cpp", "ir/ts/tsStringKeyword.cpp", + "ir/ts/tsSymbolKeyword.cpp", "ir/ts/tsTemplateLiteralType.cpp", "ir/ts/tsThisType.cpp", "ir/ts/tsTupleType.cpp", @@ -227,6 +230,7 @@ es2panda_src = [ "typescript/types/signature.cpp", "typescript/types/stringLiteralType.cpp", "typescript/types/stringType.cpp", + "typescript/types/symbolType.cpp", "typescript/types/tupleType.cpp", "typescript/types/type.cpp", "typescript/types/typeParameter.cpp", diff --git a/es2panda/CMakeLists.txt b/es2panda/CMakeLists.txt index 9a213084ed..80e619467f 100644 --- a/es2panda/CMakeLists.txt +++ b/es2panda/CMakeLists.txt @@ -206,13 +206,16 @@ set(ES2PANDA_LIB_SRC ir/ts/tsNullKeyword.cpp ir/ts/tsNumberKeyword.cpp ir/ts/tsObjectKeyword.cpp + ir/ts/tsOptionalType.cpp ir/ts/tsParameterProperty.cpp ir/ts/tsParenthesizedType.cpp ir/ts/tsPrivateIdentifier.cpp ir/ts/tsPropertySignature.cpp ir/ts/tsQualifiedName.cpp + ir/ts/tsRestType.cpp ir/ts/tsSignatureDeclaration.cpp ir/ts/tsStringKeyword.cpp + ir/ts/tsSymbolKeyword.cpp ir/ts/tsTemplateLiteralType.cpp ir/ts/tsThisType.cpp ir/ts/tsTupleType.cpp @@ -274,6 +277,7 @@ set(ES2PANDA_LIB_SRC typescript/types/signature.cpp typescript/types/stringLiteralType.cpp typescript/types/stringType.cpp + typescript/types/symbolType.cpp typescript/types/tupleType.cpp typescript/types/type.cpp typescript/types/typeParameter.cpp diff --git a/es2panda/ir/astNodeMapping.h b/es2panda/ir/astNodeMapping.h index 33c87d44a7..aa260c1c87 100644 --- a/es2panda/ir/astNodeMapping.h +++ b/es2panda/ir/astNodeMapping.h @@ -78,6 +78,7 @@ _(TS_NUMBER_KEYWORD, TSNumberKeyword) \ _(TS_ANY_KEYWORD, TSAnyKeyword) \ _(TS_STRING_KEYWORD, TSStringKeyword) \ + _(TS_SYMBOL_KEYWORD, TSSymbolKeyword) \ _(TS_BOOLEAN_KEYWORD, TSBooleanKeyword) \ _(TS_VOID_KEYWORD, TSVoidKeyword) \ _(TS_UNDEFINED_KEYWORD, TSUndefinedKeyword) \ @@ -87,6 +88,8 @@ _(TS_NEVER_KEYWORD, TSNeverKeyword) \ _(TS_NON_NULL_EXPRESSION, TSNonNullExpression) \ _(TS_NULL_KEYWORD, TSNullKeyword) \ + _(TS_OPTIONAL_TYPE, TSOptionalType) \ + _(TS_REST_TYPE, TSRestType) \ _(TS_ARRAY_TYPE, TSArrayType) \ _(TS_UNION_TYPE, TSUnionType) \ _(TS_TYPE_LITERAL, TSTypeLiteral) \ diff --git a/es2panda/ir/ts/tsMappedType.cpp b/es2panda/ir/ts/tsMappedType.cpp index 4d2a57b135..37178340cf 100644 --- a/es2panda/ir/ts/tsMappedType.cpp +++ b/es2panda/ir/ts/tsMappedType.cpp @@ -33,6 +33,7 @@ void TSMappedType::Dump(ir::AstDumper *dumper) const dumper->Add( {{"type", "TSMappedType"}, {"typeParameter", typeParameter_}, + {"nameKeyType", AstDumper::Optional(nameKeyType_)}, {"typeAnnotation", AstDumper::Optional(typeAnnotation_)}, {"readonly", readonly_ == MappedOption::NO_OPTS ? AstDumper::Optional(false) diff --git a/es2panda/ir/ts/tsMappedType.h b/es2panda/ir/ts/tsMappedType.h index 6e24cb4d3c..f7d32a4574 100644 --- a/es2panda/ir/ts/tsMappedType.h +++ b/es2panda/ir/ts/tsMappedType.h @@ -32,10 +32,11 @@ namespace panda::es2panda::ir { class TSMappedType : public TypeNode { public: - explicit TSMappedType(TSTypeParameter *typeParameter, Expression *typeAnnotation, MappedOption readonly, - MappedOption optional) + explicit TSMappedType(TSTypeParameter *typeParameter, Expression *nameKeyType, Expression *typeAnnotation, + MappedOption readonly, MappedOption optional) : TypeNode(AstNodeType::TS_MAPPED_TYPE), typeParameter_(typeParameter), + nameKeyType_(nameKeyType), typeAnnotation_(typeAnnotation), readonly_(readonly), optional_(optional) @@ -70,6 +71,7 @@ public: private: TSTypeParameter *typeParameter_; + Expression *nameKeyType_; Expression *typeAnnotation_; MappedOption readonly_; MappedOption optional_; diff --git a/es2panda/ir/ts/tsNamedTupleMember.cpp b/es2panda/ir/ts/tsNamedTupleMember.cpp index 1d70a26cac..5c76fbeef4 100644 --- a/es2panda/ir/ts/tsNamedTupleMember.cpp +++ b/es2panda/ir/ts/tsNamedTupleMember.cpp @@ -30,7 +30,8 @@ void TSNamedTupleMember::Dump(ir::AstDumper *dumper) const dumper->Add({{"type", "TSNamedTupleMember"}, {"elementType", elementType_}, {"label", label_}, - {"optional", AstDumper::Optional(optional_)}}); + {"optional", AstDumper::Optional(optional_)}, + {"rest", AstDumper::Optional(rest_)}}); } void TSNamedTupleMember::Compile([[maybe_unused]] compiler::PandaGen *pg) const {} diff --git a/es2panda/ir/ts/tsNamedTupleMember.h b/es2panda/ir/ts/tsNamedTupleMember.h index b4c5703031..135d4ed889 100644 --- a/es2panda/ir/ts/tsNamedTupleMember.h +++ b/es2panda/ir/ts/tsNamedTupleMember.h @@ -31,11 +31,12 @@ namespace panda::es2panda::ir { class TSNamedTupleMember : public Expression { public: - explicit TSNamedTupleMember(Expression *label, Expression *elementType, bool optional) + explicit TSNamedTupleMember(Expression *label, Expression *elementType, bool optional, bool rest) : Expression(AstNodeType::TS_NAMED_TUPLE_MEMBER), label_(label), elementType_(elementType), - optional_(optional) + optional_(optional), + rest_(rest) { } @@ -54,6 +55,11 @@ public: return optional_; } + bool IsRest() const + { + return rest_; + } + void Iterate(const NodeTraverser &cb) const override; void Dump(ir::AstDumper *dumper) const override; void Compile([[maybe_unused]] compiler::PandaGen *pg) const override; @@ -63,6 +69,7 @@ private: Expression *label_; Expression *elementType_; bool optional_; + bool rest_; }; } // namespace panda::es2panda::ir diff --git a/es2panda/ir/ts/tsOptionalType.cpp b/es2panda/ir/ts/tsOptionalType.cpp new file mode 100644 index 0000000000..297e6641ed --- /dev/null +++ b/es2panda/ir/ts/tsOptionalType.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "tsOptionalType.h" + +#include +#include + +namespace panda::es2panda::ir { + +void TSOptionalType::Iterate(const NodeTraverser &cb) const +{ + cb(type_); +} + +void TSOptionalType::Dump(ir::AstDumper *dumper) const +{ + dumper->Add({{"type", "TSOptionalType"}, {"typeAnnotation", type_}}); +} + +void TSOptionalType::Compile([[maybe_unused]] compiler::PandaGen *pg) const {} + +checker::Type *TSOptionalType::Check([[maybe_unused]] checker::Checker *checker) const +{ + // TODO(xucheng): Implement checker for ts optional type + return nullptr; +} + +checker::Type *TSOptionalType::GetType(checker::Checker *checker) const +{ + auto found = checker->NodeCache().find(this); + if (found != checker->NodeCache().end()) { + return found->second; + } + + checker::Type *type = type_->AsTypeNode()->GetType(checker); + checker->NodeCache().insert({this, type}); + return type; +} + +} // namespace panda::es2panda::ir diff --git a/es2panda/ir/ts/tsOptionalType.h b/es2panda/ir/ts/tsOptionalType.h new file mode 100644 index 0000000000..3d9af242b0 --- /dev/null +++ b/es2panda/ir/ts/tsOptionalType.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ES2PANDA_IR_TS_TSOPTIONAL_TYPE_H +#define ES2PANDA_IR_TS_TSOPTIONAL_TYPE_H + +#include +#include +#include + +namespace panda::es2panda::ir { + +class TSOptionalType : public TypeNode { +public: + explicit TSOptionalType(Expression *type) : TypeNode(AstNodeType::TS_OPTIONAL_TYPE), type_(type) {} + + void Iterate(const NodeTraverser &cb) const override; + void Dump(ir::AstDumper *dumper) const override; + void Compile([[maybe_unused]] compiler::PandaGen *pg) const override; + checker::Type *Check([[maybe_unused]] checker::Checker *checker) const override; + checker::Type *GetType(checker::Checker *checker) const override; + +private: + Expression *type_; +}; +} // namespace panda::es2panda::ir + +#endif diff --git a/es2panda/ir/ts/tsRestType.cpp b/es2panda/ir/ts/tsRestType.cpp new file mode 100644 index 0000000000..a3ec1e049c --- /dev/null +++ b/es2panda/ir/ts/tsRestType.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "tsRestType.h" + +#include +#include + +namespace panda::es2panda::ir { + +void TSRestType::Iterate(const NodeTraverser &cb) const +{ + cb(type_); +} + +void TSRestType::Dump(ir::AstDumper *dumper) const +{ + dumper->Add({{"type", "TSRestType"}, {"typeAnnotation", type_}}); +} + +void TSRestType::Compile([[maybe_unused]] compiler::PandaGen *pg) const {} + +checker::Type *TSRestType::Check([[maybe_unused]] checker::Checker *checker) const +{ + // TODO(xucheng): Implement checker for ts rest type + return nullptr; +} + +checker::Type *TSRestType::GetType(checker::Checker *checker) const +{ + auto found = checker->NodeCache().find(this); + if (found != checker->NodeCache().end()) { + return found->second; + } + + checker::Type *type = type_->AsTypeNode()->GetType(checker); + checker->NodeCache().insert({this, type}); + return type; +} + +} // namespace panda::es2panda::ir diff --git a/es2panda/ir/ts/tsRestType.h b/es2panda/ir/ts/tsRestType.h new file mode 100644 index 0000000000..419333842f --- /dev/null +++ b/es2panda/ir/ts/tsRestType.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ES2PANDA_IR_TS_TSREST_TYPE_H +#define ES2PANDA_IR_TS_TSREST_TYPE_H + +#include +#include +#include + +namespace panda::es2panda::ir { + +class TSRestType : public TypeNode { +public: + explicit TSRestType(Expression *type) : TypeNode(AstNodeType::TS_REST_TYPE), type_(type) {} + + void Iterate(const NodeTraverser &cb) const override; + void Dump(ir::AstDumper *dumper) const override; + void Compile([[maybe_unused]] compiler::PandaGen *pg) const override; + checker::Type *Check([[maybe_unused]] checker::Checker *checker) const override; + checker::Type *GetType(checker::Checker *checker) const override; + +private: + Expression *type_; +}; +} // namespace panda::es2panda::ir + +#endif diff --git a/es2panda/ir/ts/tsSymbolKeyword.cpp b/es2panda/ir/ts/tsSymbolKeyword.cpp new file mode 100644 index 0000000000..7234176e4f --- /dev/null +++ b/es2panda/ir/ts/tsSymbolKeyword.cpp @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "tsSymbolKeyword.h" + +#include +#include + +namespace panda::es2panda::ir { + +void TSSymbolKeyword::Iterate([[maybe_unused]] const NodeTraverser &cb) const {} + +void TSSymbolKeyword::Dump(ir::AstDumper *dumper) const +{ + dumper->Add({{"type", "TSSymbolKeyword"}}); +} + +void TSSymbolKeyword::Compile([[maybe_unused]] compiler::PandaGen *pg) const {} + +checker::Type *TSSymbolKeyword::Check([[maybe_unused]] checker::Checker *checker) const +{ + // TODO(xucheng): Implement checker for ts symbol keyword + return nullptr; +} + +checker::Type *TSSymbolKeyword::GetType(checker::Checker *checker) const +{ + return checker->GlobalSymbolType(); +} + +} // namespace panda::es2panda::ir diff --git a/es2panda/ir/ts/tsSymbolKeyword.h b/es2panda/ir/ts/tsSymbolKeyword.h new file mode 100644 index 0000000000..27e20304e8 --- /dev/null +++ b/es2panda/ir/ts/tsSymbolKeyword.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ES2PANDA_IR_TS_TSSYMBOL_KEYWORD_H +#define ES2PANDA_IR_TS_TSSYMBOL_KEYWORD_H + +#include +#include +#include + +namespace panda::es2panda::ir { + +class TSSymbolKeyword : public TypeNode { +public: + explicit TSSymbolKeyword() : TypeNode(AstNodeType::TS_SYMBOL_KEYWORD) {} + + void Iterate(const NodeTraverser &cb) const override; + void Dump(ir::AstDumper *dumper) const override; + void Compile([[maybe_unused]] compiler::PandaGen *pg) const override; + checker::Type *Check([[maybe_unused]] checker::Checker *checker) const override; + checker::Type *GetType(checker::Checker *checker) const override; +}; +} // namespace panda::es2panda::ir + +#endif diff --git a/es2panda/lexer/scripts/keywords.rb b/es2panda/lexer/scripts/keywords.rb index d3ae98705f..00183eca59 100644 --- a/es2panda/lexer/scripts/keywords.rb +++ b/es2panda/lexer/scripts/keywords.rb @@ -142,6 +142,7 @@ keywords = [ "string" => ["TokenType::LITERAL_IDENT", "TokenType::KEYW_STRING"], "super" => ["TokenType::KEYW_SUPER", "TokenType::KEYW_SUPER"], "switch" => ["TokenType::KEYW_SWITCH", "TokenType::KEYW_SWITCH"], + "symbol" => ["TokenType::LITERAL_IDENT", "TokenType::KEYW_SYMBOL"], }, # keywords start with 't' @@ -157,6 +158,7 @@ keywords = [ # keywords start with 'u' { "undefined" => ["TokenType::LITERAL_IDENT", "TokenType::KEYW_UNDEFINED"], + "unique" => ["TokenType::LITERAL_IDENT", "TokenType::KEYW_UNIQUE"], "unknown" => ["TokenType::LITERAL_IDENT", "TokenType::KEYW_UNKNOWN"], }, diff --git a/es2panda/lexer/token/tokenType.h b/es2panda/lexer/token/tokenType.h index 48f53a5099..29ddcfe28d 100644 --- a/es2panda/lexer/token/tokenType.h +++ b/es2panda/lexer/token/tokenType.h @@ -140,6 +140,7 @@ enum class TokenType { KEYW_STRING, KEYW_SUPER, KEYW_SWITCH, + KEYW_SYMBOL, KEYW_THIS, KEYW_THROW, KEYW_TYPE, @@ -155,6 +156,7 @@ enum class TokenType { KEYW_ASYNC, KEYW_READONLY, KEYW_KEYOF, + KEYW_UNIQUE, KEYW_MODULE, KEYW_NAMESPACE, KEYW_INFER, diff --git a/es2panda/parser/expressionParser.cpp b/es2panda/parser/expressionParser.cpp index e66239d189..e0d85967de 100644 --- a/es2panda/parser/expressionParser.cpp +++ b/es2panda/parser/expressionParser.cpp @@ -1457,11 +1457,21 @@ bool ParserImpl::ParsePotentialTsGenericFunctionCall(ir::Expression **returnExpr const auto savedPos = lexer_->Save(); + bool isLeftShift = false; if (lexer_->GetToken().Type() == lexer::TokenType::PUNCTUATOR_LEFT_SHIFT) { lexer_->BackwardToken(lexer::TokenType::PUNCTUATOR_LESS_THAN, 1); + isLeftShift = true; } - ir::TSTypeParameterInstantiation *typeParams = ParseTsTypeParameterInstantiation(false); + ir::TSTypeParameterInstantiation *typeParams; + try { + typeParams = ParseTsTypeParameterInstantiation(false); + } catch (const Error &e) { + if (!isLeftShift) { + throw e; + } + typeParams = nullptr; + } if (!typeParams) { lexer_->Rewind(savedPos); diff --git a/es2panda/parser/parserImpl.cpp b/es2panda/parser/parserImpl.cpp index d3039e2a13..b94cd55f1b 100644 --- a/es2panda/parser/parserImpl.cpp +++ b/es2panda/parser/parserImpl.cpp @@ -70,13 +70,16 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include +#include #include #include #include @@ -189,6 +192,7 @@ bool ParserImpl::CurrentLiteralIsBasicType() case lexer::TokenType::KEYW_BOOLEAN: case lexer::TokenType::KEYW_NUMBER: case lexer::TokenType::KEYW_STRING: + case lexer::TokenType::KEYW_SYMBOL: case lexer::TokenType::KEYW_UNKNOWN: case lexer::TokenType::KEYW_UNDEFINED: case lexer::TokenType::KEYW_NEVER: @@ -716,6 +720,7 @@ ir::Expression *ParserImpl::ParseTsTypeOperatorOrTypeReference() options |= TypeAnnotationParsingOptions::IN_MODIFIER; ir::Expression *type = ParseTsTypeAnnotation(&options); + ASSERT(type != nullptr); if (!type->IsTSArrayType() && !type->IsTSTupleType()) { ThrowSyntaxError( @@ -736,6 +741,7 @@ ir::Expression *ParserImpl::ParseTsTypeOperatorOrTypeReference() options |= TypeAnnotationParsingOptions::IN_MODIFIER; ir::Expression *type = ParseTsTypeAnnotation(&options); + ASSERT(type != nullptr); auto *typeOperator = AllocNode(type, ir::TSOperatorType::KEYOF); @@ -744,6 +750,20 @@ ir::Expression *ParserImpl::ParseTsTypeOperatorOrTypeReference() return typeOperator; } + if (lexer_->GetToken().KeywordType() == lexer::TokenType::KEYW_UNIQUE) { + lexer::SourcePosition typeOperatorStart = lexer_->GetToken().Start(); + lexer_->NextToken(); + + ir::Expression *type = ParseTsTypeAnnotation(&options); + ASSERT(type != nullptr); + + auto *typeOperator = AllocNode(type, ir::TSOperatorType::UNIQUE); + + typeOperator->SetRange({typeOperatorStart, type->End()}); + + return typeOperator; + } + if (lexer_->GetToken().KeywordType() == lexer::TokenType::KEYW_INFER) { if (!(context_.Status() & ParserStatus::IN_EXTENDS)) { ThrowSyntaxError( @@ -766,59 +786,84 @@ ir::Expression *ParserImpl::ParseTsTypeOperatorOrTypeReference() return ParseTsIdentifierReference(); } +bool ParserImpl::IsTSNamedTupleMember() +{ + if (lexer_->GetToken().Type() != lexer::TokenType::LITERAL_IDENT) { + return false; + } + const auto savePos = lexer_->Save(); + bool isNamedMember = false; + lexer_->NextToken(); + if (lexer_->GetToken().Type() == lexer::TokenType::PUNCTUATOR_COLON || + (lexer_->GetToken().Type() == lexer::TokenType::PUNCTUATOR_QUESTION_MARK && + lexer_->Lookahead() == LEX_CHAR_COLON)) { + isNamedMember = true; + } + lexer_->Rewind(savePos); + return isNamedMember; +} + ir::Expression *ParserImpl::ParseTsTupleElement(ir::TSTupleKind *kind, bool *seenOptional) { - lexer::SourcePosition elementStart = lexer_->GetToken().Start(); + lexer::SourcePosition startPos = lexer_->GetToken().Start(); ir::Expression *element = nullptr; bool isOptional = false; + bool isRestType = false; TypeAnnotationParsingOptions options = TypeAnnotationParsingOptions::THROW_ERROR; - if (lexer_->GetToken().Type() == lexer::TokenType::LITERAL_IDENT && !CurrentLiteralIsBasicType()) { - auto *elementIdent = AllocNode(lexer_->GetToken().Ident(), Allocator()); - elementIdent->SetRange(lexer_->GetToken().Loc()); + if (lexer_->GetToken().Type() == lexer::TokenType::PUNCTUATOR_PERIOD_PERIOD_PERIOD) { + isRestType = true; + lexer_->NextToken(); // eat '...' + } - if (lexer_->Lookahead() == LEX_CHAR_COLON || lexer_->Lookahead() == LEX_CHAR_QUESTION) { - if (*kind == ir::TSTupleKind::DEFAULT) { - ThrowSyntaxError("Tuple members must all have names or all not have names"); - } + if (IsTSNamedTupleMember()) { + if (*kind == ir::TSTupleKind::DEFAULT) { + ThrowSyntaxError("Tuple members must all have or haven't names"); + } + *kind = ir::TSTupleKind::NAMED; - lexer_->NextToken(); // eat ident + auto *elementIdent = AllocNode(lexer_->GetToken().Ident(), Allocator()); + elementIdent->SetRange(lexer_->GetToken().Loc()); + lexer_->NextToken(); // eat identifier - if (lexer_->GetToken().Type() == lexer::TokenType::PUNCTUATOR_QUESTION_MARK) { - lexer_->NextToken(); // eat '?' - isOptional = true; - *seenOptional = true; - } else if (*seenOptional) { - ThrowSyntaxError("A required element cannot follow an optional element"); - } + if (lexer_->GetToken().Type() == lexer::TokenType::PUNCTUATOR_QUESTION_MARK) { + lexer_->NextToken(); // eat '?' + isOptional = true; + *seenOptional = true; + } else if (*seenOptional) { + ThrowSyntaxError("A required element cannot follow an optional element"); + } - if (lexer_->GetToken().Type() != lexer::TokenType::PUNCTUATOR_COLON) { - ThrowSyntaxError("':' expected"); - } + if (lexer_->GetToken().Type() != lexer::TokenType::PUNCTUATOR_COLON) { + ThrowSyntaxError("':' expected"); + } - lexer_->NextToken(); // eat ':' - auto *elementType = ParseTsTypeAnnotation(&options); - *kind = ir::TSTupleKind::NAMED; + lexer_->NextToken(); // eat ':' + auto *elementType = ParseTsTypeAnnotation(&options); + ASSERT(elementType != nullptr); - element = AllocNode(elementIdent, elementType, isOptional); - } else { - element = ParseTsTypeReferenceOrQuery(); - } - if (lexer_->GetToken().Type() != lexer::TokenType::PUNCTUATOR_COMMA && - lexer_->GetToken().Type() != lexer::TokenType::PUNCTUATOR_RIGHT_SQUARE_BRACKET) { - element = ParseTsTypeAnnotationElement(element, &options); - } + element = AllocNode(elementIdent, elementType, isOptional, isRestType); + element->SetRange({startPos, elementType->End()}); } else { if (*kind == ir::TSTupleKind::NAMED) { - ThrowSyntaxError("Tuple members must all have names or all not have names"); + ThrowSyntaxError("Tuple members must all have or haven't names"); } - *kind = ir::TSTupleKind::DEFAULT; + element = ParseTsTypeAnnotation(&options); - } + ASSERT(element != nullptr); + if (element && isRestType) { + lexer::SourcePosition endPos = element->End(); + element = AllocNode(std::move(element)); + element->SetRange({startPos, endPos}); + } - if (element) { - element->SetRange({elementStart, lexer_->GetToken().End()}); + if (lexer_->GetToken().Type() == lexer::TokenType::PUNCTUATOR_QUESTION_MARK) { + lexer::SourcePosition elementStartPos = element->Start(); + element = AllocNode(std::move(element)); + element->SetRange({elementStartPos, lexer_->GetToken().End()}); + lexer_->NextToken(); // eat '?' + } } return element; } @@ -835,6 +880,7 @@ ir::TSTupleType *ParserImpl::ParseTsTupleType() while (lexer_->GetToken().Type() != lexer::TokenType::PUNCTUATOR_RIGHT_SQUARE_BRACKET) { ir::Expression *element = ParseTsTupleElement(&kind, &seenOptional); + elements.push_back(element); if (lexer_->GetToken().Type() == lexer::TokenType::PUNCTUATOR_RIGHT_SQUARE_BRACKET) { @@ -1037,6 +1083,14 @@ ir::TSMappedType *ParserImpl::ParseTsMappedType() ir::TSTypeParameter *typeParameter = ParseTsMappedTypeParameter(); + ir::Expression *nameKeyType = nullptr; + if (lexer_->GetToken().KeywordType() == lexer::TokenType::KEYW_AS) { + lexer_->NextToken(); // eat 'as' + TypeAnnotationParsingOptions options = TypeAnnotationParsingOptions::THROW_ERROR; + nameKeyType = ParseTsTypeAnnotation(&options); + ASSERT(nameKeyType != nullptr); + } + if (lexer_->GetToken().Type() != lexer::TokenType::PUNCTUATOR_RIGHT_SQUARE_BRACKET) { ThrowSyntaxError("']' expected"); } @@ -1065,7 +1119,7 @@ ir::TSMappedType *ParserImpl::ParseTsMappedType() ThrowSyntaxError("'}' expected"); } - auto *mappedType = AllocNode(typeParameter, typeAnnotation, readonly, optional); + auto *mappedType = AllocNode(typeParameter, nameKeyType, typeAnnotation, readonly, optional); mappedType->SetRange({startLoc, lexer_->GetToken().End()}); @@ -1706,6 +1760,8 @@ ir::Expression *ParserImpl::ParseTsBasicType() typeAnnotation = AllocNode(); } else if (lexer_->GetToken().KeywordType() == lexer::TokenType::KEYW_BIGINT) { typeAnnotation = AllocNode(); + } else if (lexer_->GetToken().KeywordType() == lexer::TokenType::KEYW_SYMBOL) { + typeAnnotation = AllocNode(); } else { ThrowSyntaxError("Unexpected type"); } @@ -2082,7 +2138,8 @@ ir::Expression *ParserImpl::ParseClassKey(ClassElmentDescriptor *desc, bool isDe desc->invalidComputedProperty = !propName->IsNumberLiteral() && !propName->IsStringLiteral() && !(propName->IsMemberExpression() && propName->AsMemberExpression()->Object()->IsIdentifier() && - propName->AsMemberExpression()->Object()->AsIdentifier()->Name().Is("Symbol")); + propName->AsMemberExpression()->Object()->AsIdentifier()->Name().Is("Symbol")) && + !propName->IsIdentifier(); } if (lexer_->GetToken().Type() != lexer::TokenType::PUNCTUATOR_RIGHT_SQUARE_BRACKET) { diff --git a/es2panda/parser/parserImpl.h b/es2panda/parser/parserImpl.h index ed541f881c..3bc4cc2811 100644 --- a/es2panda/parser/parserImpl.h +++ b/es2panda/parser/parserImpl.h @@ -251,6 +251,7 @@ private: ir::Expression *ParseTsIndexAccessType(ir::Expression *typeName); ir::Expression *ParseTsQualifiedReference(ir::Expression *typeName); ir::Expression *ParseTsTypeReferenceOrQuery(bool parseQuery = false); + bool IsTSNamedTupleMember(); ir::Expression *ParseTsTupleElement(ir::TSTupleKind *kind, bool *seenOptional); ir::TSTupleType *ParseTsTupleType(); ir::TSImportType *ParseTsImportType(const lexer::SourcePosition &startLoc, bool isTypeof = false); diff --git a/es2panda/test/parser/ts/test-enum-declaration6-expected.txt b/es2panda/test/parser/ts/test-enum-declaration6-expected.txt new file mode 100644 index 0000000000..a679aa60af --- /dev/null +++ b/es2panda/test/parser/ts/test-enum-declaration6-expected.txt @@ -0,0 +1,374 @@ +{ + "type": "Program", + "statements": [ + { + "type": "TSEnumDeclaration", + "id": { + "type": "Identifier", + "name": "ShiftE", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 12 + } + } + }, + "members": [ + { + "type": "TSEnumMember", + "id": { + "type": "Identifier", + "name": "A", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 6 + } + } + }, + "initializer": { + "type": "NumberLiteral", + "value": 1, + "loc": { + "start": { + "line": 18, + "column": 9 + }, + "end": { + "line": 18, + "column": 10 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 9 + }, + "end": { + "line": 18, + "column": 11 + } + } + }, + { + "type": "TSEnumMember", + "id": { + "type": "Identifier", + "name": "B", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 6 + } + } + }, + "initializer": { + "type": "BinaryExpression", + "operator": "<<", + "left": { + "type": "Identifier", + "name": "A", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 9 + }, + "end": { + "line": 19, + "column": 10 + } + } + }, + "right": { + "type": "Identifier", + "name": "A", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 14 + }, + "end": { + "line": 19, + "column": 15 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 9 + }, + "end": { + "line": 19, + "column": 15 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 9 + }, + "end": { + "line": 19, + "column": 16 + } + } + }, + { + "type": "TSEnumMember", + "id": { + "type": "Identifier", + "name": "C", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 6 + } + } + }, + "initializer": { + "type": "BinaryExpression", + "operator": "<<", + "left": { + "type": "Identifier", + "name": "B", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 9 + }, + "end": { + "line": 20, + "column": 10 + } + } + }, + "right": { + "type": "NumberLiteral", + "value": 1, + "loc": { + "start": { + "line": 20, + "column": 14 + }, + "end": { + "line": 20, + "column": 15 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 9 + }, + "end": { + "line": 20, + "column": 15 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 9 + }, + "end": { + "line": 20, + "column": 16 + } + } + }, + { + "type": "TSEnumMember", + "id": { + "type": "Identifier", + "name": "D", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 5 + }, + "end": { + "line": 21, + "column": 6 + } + } + }, + "initializer": { + "type": "BinaryExpression", + "operator": "<<", + "left": { + "type": "Identifier", + "name": "C", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 9 + }, + "end": { + "line": 21, + "column": 10 + } + } + }, + "right": { + "type": "Identifier", + "name": "B", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 14 + }, + "end": { + "line": 21, + "column": 15 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 9 + }, + "end": { + "line": 21, + "column": 15 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 9 + }, + "end": { + "line": 21, + "column": 16 + } + } + }, + { + "type": "TSEnumMember", + "id": { + "type": "Identifier", + "name": "E", + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 5 + }, + "end": { + "line": 22, + "column": 6 + } + } + }, + "initializer": { + "type": "BinaryExpression", + "operator": "<<", + "left": { + "type": "Identifier", + "name": "D", + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 9 + }, + "end": { + "line": 22, + "column": 10 + } + } + }, + "right": { + "type": "NumberLiteral", + "value": 2, + "loc": { + "start": { + "line": 22, + "column": 14 + }, + "end": { + "line": 22, + "column": 15 + } + } + }, + "loc": { + "start": { + "line": 22, + "column": 9 + }, + "end": { + "line": 22, + "column": 15 + } + } + }, + "loc": { + "start": { + "line": 22, + "column": 9 + }, + "end": { + "line": 22, + "column": 16 + } + } + } + ], + "const": false, + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 23, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 23, + "column": 2 + } + } +} diff --git a/es2panda/test/parser/ts/test-enum-declaration6.ts b/es2panda/test/parser/ts/test-enum-declaration6.ts new file mode 100644 index 0000000000..3fb14ee994 --- /dev/null +++ b/es2panda/test/parser/ts/test-enum-declaration6.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +enum ShiftE { + A = 1, + B = A << A, + C = B << 1, + D = C << B, + E = D << 2, +} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-func-param-expected.txt b/es2panda/test/parser/ts/test-func-param-expected.txt index 6a8699ea81..360ebf454c 100644 --- a/es2panda/test/parser/ts/test-func-param-expected.txt +++ b/es2panda/test/parser/ts/test-func-param-expected.txt @@ -678,7 +678,7 @@ }, "end": { "line": 21, - "column": 32 + "column": 31 } } }, @@ -691,7 +691,7 @@ }, "end": { "line": 21, - "column": 40 + "column": 39 } } } @@ -1270,7 +1270,7 @@ }, "end": { "line": 23, - "column": 40 + "column": 39 } } }, @@ -1283,7 +1283,7 @@ }, "end": { "line": 23, - "column": 48 + "column": 47 } } } @@ -1662,7 +1662,7 @@ }, "end": { "line": 25, - "column": 41 + "column": 40 } } }, @@ -1675,7 +1675,7 @@ }, "end": { "line": 25, - "column": 49 + "column": 48 } } } diff --git a/es2panda/test/parser/ts/test-ts-key-remapping-via-as-expected.txt b/es2panda/test/parser/ts/test-ts-key-remapping-via-as-expected.txt new file mode 100644 index 0000000000..d93d9a7321 --- /dev/null +++ b/es2panda/test/parser/ts/test-ts-key-remapping-via-as-expected.txt @@ -0,0 +1,900 @@ +{ + "type": "Program", + "statements": [ + { + "type": "TSTypeAliasDeclaration", + "id": { + "type": "Identifier", + "name": "GetName", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 6 + }, + "end": { + "line": 17, + "column": 13 + } + } + }, + "typeAnnotation": { + "type": "TSMappedType", + "typeParameter": { + "type": "TSTypeParameter", + "name": { + "type": "Identifier", + "name": "p", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 7 + } + } + }, + "constraint": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Type", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 11 + }, + "end": { + "line": 18, + "column": 15 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 11 + }, + "end": { + "line": 18, + "column": 15 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 6 + }, + "end": { + "line": 18, + "column": 15 + } + } + }, + "nameKeyType": { + "type": "TSIndexedAccessType", + "objectType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "p", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 19 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 19 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "indexType": { + "type": "TSLiteralType", + "literal": { + "type": "StringLiteral", + "value": "name", + "loc": { + "start": { + "line": 18, + "column": 21 + }, + "end": { + "line": 18, + "column": 27 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 21 + }, + "end": { + "line": 18, + "column": 27 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 19 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "typeAnnotation": { + "type": "TSNumberKeyword", + "loc": { + "start": { + "line": 18, + "column": 32 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 17, + "column": 45 + }, + "end": { + "line": 19, + "column": 2 + } + } + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "params": [ + { + "type": "TSTypeParameter", + "name": { + "type": "Identifier", + "name": "Type", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 14 + }, + "end": { + "line": 17, + "column": 18 + } + } + }, + "constraint": { + "type": "TSTypeLiteral", + "members": [ + { + "type": "TSPropertySignature", + "computed": false, + "optional": false, + "readonly": false, + "key": { + "type": "Identifier", + "name": "name", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 32 + } + } + }, + "typeAnnotation": { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 17, + "column": 34 + }, + "end": { + "line": 17, + "column": 40 + } + } + }, + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 41 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 27 + }, + "end": { + "line": 17, + "column": 41 + } + } + }, + "loc": { + "start": { + "line": 17, + "column": 14 + }, + "end": { + "line": 17, + "column": 42 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 13 + }, + "end": { + "line": 17, + "column": 42 + } + } + }, + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 20, + "column": 5 + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "id": { + "type": "Identifier", + "name": "NameA", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 20, + "column": 11 + } + } + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "members": [ + { + "type": "TSPropertySignature", + "computed": false, + "optional": false, + "readonly": false, + "key": { + "type": "Identifier", + "name": "name", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 15 + }, + "end": { + "line": 20, + "column": 19 + } + } + }, + "typeAnnotation": { + "type": "TSLiteralType", + "literal": { + "type": "StringLiteral", + "value": "A", + "loc": { + "start": { + "line": 20, + "column": 21 + }, + "end": { + "line": 20, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 21 + }, + "end": { + "line": 20, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 15 + }, + "end": { + "line": 20, + "column": 25 + } + } + }, + { + "type": "TSPropertySignature", + "computed": false, + "optional": false, + "readonly": false, + "key": { + "type": "Identifier", + "name": "kind", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 26 + }, + "end": { + "line": 20, + "column": 30 + } + } + }, + "typeAnnotation": { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 20, + "column": 32 + }, + "end": { + "line": 20, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 26 + }, + "end": { + "line": 20, + "column": 39 + } + } + } + ], + "loc": { + "start": { + "line": 20, + "column": 14 + }, + "end": { + "line": 20, + "column": 39 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 1 + }, + "end": { + "line": 21, + "column": 5 + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "id": { + "type": "Identifier", + "name": "NameB", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 6 + }, + "end": { + "line": 21, + "column": 11 + } + } + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "members": [ + { + "type": "TSPropertySignature", + "computed": false, + "optional": false, + "readonly": false, + "key": { + "type": "Identifier", + "name": "name", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 15 + }, + "end": { + "line": 21, + "column": 19 + } + } + }, + "typeAnnotation": { + "type": "TSLiteralType", + "literal": { + "type": "StringLiteral", + "value": "B", + "loc": { + "start": { + "line": 21, + "column": 21 + }, + "end": { + "line": 21, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 21 + }, + "end": { + "line": 21, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 15 + }, + "end": { + "line": 21, + "column": 25 + } + } + }, + { + "type": "TSPropertySignature", + "computed": false, + "optional": false, + "readonly": false, + "key": { + "type": "Identifier", + "name": "kind", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 26 + }, + "end": { + "line": 21, + "column": 30 + } + } + }, + "typeAnnotation": { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 21, + "column": 32 + }, + "end": { + "line": 21, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 26 + }, + "end": { + "line": 21, + "column": 39 + } + } + } + ], + "loc": { + "start": { + "line": 21, + "column": 14 + }, + "end": { + "line": 21, + "column": 39 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 1 + }, + "end": { + "line": 22, + "column": 5 + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "id": { + "type": "Identifier", + "name": "NameC", + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 6 + }, + "end": { + "line": 22, + "column": 11 + } + } + }, + "typeAnnotation": { + "type": "TSTypeLiteral", + "members": [ + { + "type": "TSPropertySignature", + "computed": false, + "optional": false, + "readonly": false, + "key": { + "type": "Identifier", + "name": "name", + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 15 + }, + "end": { + "line": 22, + "column": 19 + } + } + }, + "typeAnnotation": { + "type": "TSLiteralType", + "literal": { + "type": "StringLiteral", + "value": "C", + "loc": { + "start": { + "line": 22, + "column": 21 + }, + "end": { + "line": 22, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 22, + "column": 21 + }, + "end": { + "line": 22, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 22, + "column": 15 + }, + "end": { + "line": 22, + "column": 25 + } + } + }, + { + "type": "TSPropertySignature", + "computed": false, + "optional": false, + "readonly": false, + "key": { + "type": "Identifier", + "name": "kind", + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 26 + }, + "end": { + "line": 22, + "column": 30 + } + } + }, + "typeAnnotation": { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 22, + "column": 32 + }, + "end": { + "line": 22, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 22, + "column": 26 + }, + "end": { + "line": 22, + "column": 39 + } + } + } + ], + "loc": { + "start": { + "line": 22, + "column": 14 + }, + "end": { + "line": 22, + "column": 39 + } + } + }, + "loc": { + "start": { + "line": 22, + "column": 1 + }, + "end": { + "line": 23, + "column": 5 + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "id": { + "type": "Identifier", + "name": "Name", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 6 + }, + "end": { + "line": 23, + "column": 10 + } + } + }, + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "GetName", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 13 + }, + "end": { + "line": 23, + "column": 20 + } + } + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "params": [ + { + "type": "TSUnionType", + "types": [ + { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "NameA", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 21 + }, + "end": { + "line": 23, + "column": 26 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 21 + }, + "end": { + "line": 23, + "column": 26 + } + } + }, + { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "NameB", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 29 + }, + "end": { + "line": 23, + "column": 34 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 29 + }, + "end": { + "line": 23, + "column": 34 + } + } + }, + { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "NameC", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 37 + }, + "end": { + "line": 23, + "column": 42 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 37 + }, + "end": { + "line": 23, + "column": 42 + } + } + } + ], + "loc": { + "start": { + "line": 23, + "column": 21 + }, + "end": { + "line": 23, + "column": 42 + } + } + } + ], + "loc": { + "start": { + "line": 23, + "column": 13 + }, + "end": { + "line": 23, + "column": 43 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 13 + }, + "end": { + "line": 23, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 1 + }, + "end": { + "line": 23, + "column": 43 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 23, + "column": 43 + } + } +} diff --git a/es2panda/test/parser/ts/test-ts-key-remapping-via-as.ts b/es2panda/test/parser/ts/test-ts-key-remapping-via-as.ts new file mode 100644 index 0000000000..432297669c --- /dev/null +++ b/es2panda/test/parser/ts/test-ts-key-remapping-via-as.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +type GetName = { + [p in Type as p["name"]] : number; +} +type NameA = {name: "A", kind: string} +type NameB = {name: "B", kind: string} +type NameC = {name: "C", kind: string} +type Name = GetName \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-symbol-type-expected.txt b/es2panda/test/parser/ts/test-ts-symbol-type-expected.txt new file mode 100644 index 0000000000..500309772e --- /dev/null +++ b/es2panda/test/parser/ts/test-ts-symbol-type-expected.txt @@ -0,0 +1,268 @@ +{ + "type": "Program", + "statements": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "s", + "typeAnnotation": { + "type": "TSSymbolKeyword", + "loc": { + "start": { + "line": 17, + "column": 9 + }, + "end": { + "line": 17, + "column": 15 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 5 + }, + "end": { + "line": 17, + "column": 6 + } + } + }, + "init": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "Symbol", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 18 + }, + "end": { + "line": 17, + "column": 24 + } + } + }, + "arguments": [ + { + "type": "StringLiteral", + "value": "foo", + "loc": { + "start": { + "line": 17, + "column": 25 + }, + "end": { + "line": 17, + "column": 30 + } + } + } + ], + "optional": false, + "loc": { + "start": { + "line": 17, + "column": 18 + }, + "end": { + "line": 17, + "column": 31 + } + } + }, + "loc": { + "start": { + "line": 17, + "column": 5 + }, + "end": { + "line": 17, + "column": 31 + } + } + } + ], + "kind": "var", + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 17, + "column": 32 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "symbolVar", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 14 + } + } + }, + "init": { + "type": "ObjectExpression", + "properties": [ + { + "type": "Property", + "method": false, + "shorthand": false, + "computed": false, + "key": { + "type": "Identifier", + "name": "a", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 6 + } + } + }, + "value": { + "type": "NumberLiteral", + "value": 1, + "loc": { + "start": { + "line": 19, + "column": 9 + }, + "end": { + "line": 19, + "column": 10 + } + } + }, + "kind": "init", + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 10 + } + } + }, + { + "type": "Property", + "method": false, + "shorthand": false, + "computed": true, + "key": { + "type": "Identifier", + "name": "s", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 20, + "column": 7 + } + } + }, + "value": { + "type": "StringLiteral", + "value": "string", + "loc": { + "start": { + "line": 20, + "column": 11 + }, + "end": { + "line": 20, + "column": 19 + } + } + }, + "kind": "init", + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 19 + } + } + } + ], + "loc": { + "start": { + "line": 18, + "column": 17 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 21, + "column": 2 + } + } + } + ], + "kind": "var", + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 21, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 21, + "column": 2 + } + } +} diff --git a/es2panda/test/parser/ts/test-ts-symbol-type.ts b/es2panda/test/parser/ts/test-ts-symbol-type.ts new file mode 100644 index 0000000000..8b2e79d3b4 --- /dev/null +++ b/es2panda/test/parser/ts/test-ts-symbol-type.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +var s : symbol = Symbol("foo"); +var symbolVar = { + a : 1, + [s] : "string", +} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-unique-symbol-type-expected.txt b/es2panda/test/parser/ts/test-ts-unique-symbol-type-expected.txt new file mode 100644 index 0000000000..c8f6a920d1 --- /dev/null +++ b/es2panda/test/parser/ts/test-ts-unique-symbol-type-expected.txt @@ -0,0 +1,363 @@ +{ + "type": "Program", + "statements": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "s2", + "typeAnnotation": { + "type": "TSTypeOperator", + "operator": "unique", + "typeAnnotation": { + "type": "TSSymbolKeyword", + "loc": { + "start": { + "line": 17, + "column": 19 + }, + "end": { + "line": 17, + "column": 25 + } + } + }, + "loc": { + "start": { + "line": 17, + "column": 12 + }, + "end": { + "line": 17, + "column": 25 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 9 + } + } + }, + "init": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "Symbol", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 34 + } + } + }, + "arguments": [], + "optional": false, + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 17, + "column": 36 + } + } + }, + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 36 + } + } + } + ], + "kind": "const", + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 17, + "column": 37 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "SymbolClass", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 7 + }, + "end": { + "line": 18, + "column": 18 + } + } + }, + "superClass": null, + "implements": [], + "constructor": { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": null, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "body": [ + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "a", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 6 + } + } + }, + "value": { + "type": "StringLiteral", + "value": "a", + "loc": { + "start": { + "line": 19, + "column": 18 + }, + "end": { + "line": 19, + "column": 21 + } + } + }, + "static": false, + "readonly": false, + "declare": false, + "optional": false, + "computed": false, + "typeAnnotation": { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 19, + "column": 9 + }, + "end": { + "line": 19, + "column": 15 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 21 + } + } + }, + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "s2", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 20, + "column": 8 + } + } + }, + "value": { + "type": "NumberLiteral", + "value": 2, + "loc": { + "start": { + "line": 20, + "column": 21 + }, + "end": { + "line": 20, + "column": 22 + } + } + }, + "static": false, + "readonly": false, + "declare": false, + "optional": false, + "computed": true, + "typeAnnotation": { + "type": "TSNumberKeyword", + "loc": { + "start": { + "line": 20, + "column": 12 + }, + "end": { + "line": 20, + "column": 18 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 22 + } + } + } + ], + "indexSignatures": [], + "loc": { + "start": { + "line": 18, + "column": 18 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 21, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 21, + "column": 2 + } + } +} diff --git a/es2panda/test/parser/ts/test-ts-unique-symbol-type.ts b/es2panda/test/parser/ts/test-ts-unique-symbol-type.ts new file mode 100644 index 0000000000..f445074c8f --- /dev/null +++ b/es2panda/test/parser/ts/test-ts-unique-symbol-type.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +const s2 : unique symbol = Symbol(); +class SymbolClass{ + a : string = "a"; + [s2] : number = 2; +} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-tuple-type-expected.txt b/es2panda/test/parser/ts/test-tuple-type-expected.txt index 8e576727c9..474686f08a 100644 --- a/es2panda/test/parser/ts/test-tuple-type-expected.txt +++ b/es2panda/test/parser/ts/test-tuple-type-expected.txt @@ -49,7 +49,7 @@ }, "end": { "line": 17, - "column": 19 + "column": 18 } } }, @@ -90,7 +90,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 29 } } }, @@ -185,7 +185,7 @@ }, "end": { "line": 17, - "column": 53 + "column": 52 } } } @@ -258,7 +258,7 @@ }, "end": { "line": 18, - "column": 16 + "column": 15 } } }, @@ -271,7 +271,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 23 } } }, @@ -284,7 +284,7 @@ }, "end": { "line": 18, - "column": 32 + "column": 31 } } } @@ -388,7 +388,7 @@ }, "end": { "line": 19, - "column": 20 + "column": 19 } } }, @@ -429,7 +429,7 @@ }, "end": { "line": 19, - "column": 31 + "column": 30 } } } @@ -441,7 +441,7 @@ }, "end": { "line": 19, - "column": 32 + "column": 31 } } }, @@ -491,7 +491,7 @@ }, "end": { "line": 19, - "column": 55 + "column": 54 } } }, @@ -504,7 +504,7 @@ }, "end": { "line": 19, - "column": 64 + "column": 63 } } } @@ -553,7 +553,7 @@ }, "end": { "line": 19, - "column": 79 + "column": 78 } } } @@ -632,7 +632,7 @@ }, "end": { "line": 20, - "column": 18 + "column": 17 } } }, @@ -645,7 +645,7 @@ }, "end": { "line": 20, - "column": 26 + "column": 25 } } } @@ -657,7 +657,7 @@ }, "end": { "line": 20, - "column": 27 + "column": 26 } } }, @@ -670,7 +670,7 @@ }, "end": { "line": 20, - "column": 35 + "column": 34 } } }, @@ -683,7 +683,7 @@ }, "end": { "line": 20, - "column": 43 + "column": 42 } } } @@ -695,7 +695,7 @@ }, "end": { "line": 20, - "column": 44 + "column": 43 } } }, @@ -708,7 +708,7 @@ }, "end": { "line": 20, - "column": 52 + "column": 51 } } }, @@ -721,7 +721,7 @@ }, "end": { "line": 20, - "column": 60 + "column": 59 } } } @@ -852,7 +852,7 @@ }, "end": { "line": 21, - "column": 14 + "column": 10 } } } diff --git a/es2panda/test/parser/ts/test-tuple-type2-expected.txt b/es2panda/test/parser/ts/test-tuple-type2-expected.txt index 7329971951..e2affa9688 100644 --- a/es2panda/test/parser/ts/test-tuple-type2-expected.txt +++ b/es2panda/test/parser/ts/test-tuple-type2-expected.txt @@ -1 +1 @@ -SyntaxError: Tuple members must all have names or all not have names [test-tuple-type2.ts:17:17] +SyntaxError: Tuple members must all have or haven't names [test-tuple-type2.ts:17:17] diff --git a/es2panda/test/parser/ts/test-tuple-type5-expected.txt b/es2panda/test/parser/ts/test-tuple-type5-expected.txt new file mode 100644 index 0000000000..5454b9fc2b --- /dev/null +++ b/es2panda/test/parser/ts/test-tuple-type5-expected.txt @@ -0,0 +1,1691 @@ +{ + "type": "Program", + "statements": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "x1", + "typeAnnotation": { + "type": "TSTupleType", + "elementTypes": [ + { + "type": "TSNumberKeyword", + "loc": { + "start": { + "line": 17, + "column": 11 + }, + "end": { + "line": 17, + "column": 17 + } + } + }, + { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 17, + "column": 19 + }, + "end": { + "line": 17, + "column": 25 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 10 + }, + "end": { + "line": 17, + "column": 26 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 5 + }, + "end": { + "line": 17, + "column": 7 + } + } + }, + "init": null, + "loc": { + "start": { + "line": 17, + "column": 5 + }, + "end": { + "line": 17, + "column": 7 + } + } + } + ], + "kind": "var", + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 17, + "column": 27 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "x2", + "typeAnnotation": { + "type": "TSTupleType", + "elementTypes": [ + { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 18, + "column": 11 + }, + "end": { + "line": 18, + "column": 17 + } + } + }, + { + "type": "TSRestType", + "typeAnnotation": { + "type": "TSArrayType", + "elementType": { + "type": "TSNumberKeyword", + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 19 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 18, + "column": 32 + }, + "end": { + "line": 18, + "column": 38 + } + } + } + ], + "loc": { + "start": { + "line": 18, + "column": 10 + }, + "end": { + "line": 18, + "column": 39 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 7 + } + } + }, + "init": null, + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 7 + } + } + } + ], + "kind": "var", + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 18, + "column": 40 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "x3", + "typeAnnotation": { + "type": "TSTupleType", + "elementTypes": [ + { + "type": "TSNamedTupleMember", + "elementType": { + "type": "TSBooleanKeyword", + "loc": { + "start": { + "line": 19, + "column": 15 + }, + "end": { + "line": 19, + "column": 22 + } + } + }, + "label": { + "type": "Identifier", + "name": "a", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 11 + }, + "end": { + "line": 19, + "column": 12 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 11 + }, + "end": { + "line": 19, + "column": 22 + } + } + }, + { + "type": "TSNamedTupleMember", + "elementType": { + "type": "TSArrayType", + "elementType": { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 19, + "column": 30 + }, + "end": { + "line": 19, + "column": 36 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 30 + }, + "end": { + "line": 19, + "column": 38 + } + } + }, + "label": { + "type": "Identifier", + "name": "b", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 27 + }, + "end": { + "line": 19, + "column": 28 + } + } + }, + "rest": true, + "loc": { + "start": { + "line": 19, + "column": 24 + }, + "end": { + "line": 19, + "column": 38 + } + } + }, + { + "type": "TSNamedTupleMember", + "elementType": { + "type": "TSNumberKeyword", + "loc": { + "start": { + "line": 19, + "column": 44 + }, + "end": { + "line": 19, + "column": 50 + } + } + }, + "label": { + "type": "Identifier", + "name": "c", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 40 + }, + "end": { + "line": 19, + "column": 41 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 40 + }, + "end": { + "line": 19, + "column": 50 + } + } + } + ], + "loc": { + "start": { + "line": 19, + "column": 10 + }, + "end": { + "line": 19, + "column": 51 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 7 + } + } + }, + "init": null, + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 7 + } + } + } + ], + "kind": "var", + "loc": { + "start": { + "line": 19, + "column": 1 + }, + "end": { + "line": 19, + "column": 52 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "x4", + "typeAnnotation": { + "type": "TSTupleType", + "elementTypes": [ + { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 20, + "column": 11 + }, + "end": { + "line": 20, + "column": 17 + } + } + }, + { + "type": "TSOptionalType", + "typeAnnotation": { + "type": "TSNumberKeyword", + "loc": { + "start": { + "line": 20, + "column": 19 + }, + "end": { + "line": 20, + "column": 25 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 19 + }, + "end": { + "line": 20, + "column": 26 + } + } + } + ], + "loc": { + "start": { + "line": 20, + "column": 10 + }, + "end": { + "line": 20, + "column": 27 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 7 + } + } + }, + "init": null, + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 7 + } + } + } + ], + "kind": "var", + "loc": { + "start": { + "line": 20, + "column": 1 + }, + "end": { + "line": 20, + "column": 28 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "x5", + "typeAnnotation": { + "type": "TSTupleType", + "elementTypes": [ + { + "type": "TSNamedTupleMember", + "elementType": { + "type": "TSNumberKeyword", + "loc": { + "start": { + "line": 21, + "column": 15 + }, + "end": { + "line": 21, + "column": 21 + } + } + }, + "label": { + "type": "Identifier", + "name": "a", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 11 + }, + "end": { + "line": 21, + "column": 12 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 11 + }, + "end": { + "line": 21, + "column": 21 + } + } + }, + { + "type": "TSNamedTupleMember", + "elementType": { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 21, + "column": 28 + }, + "end": { + "line": 21, + "column": 34 + } + } + }, + "label": { + "type": "Identifier", + "name": "b", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 23 + }, + "end": { + "line": 21, + "column": 24 + } + } + }, + "optional": true, + "loc": { + "start": { + "line": 21, + "column": 23 + }, + "end": { + "line": 21, + "column": 34 + } + } + } + ], + "loc": { + "start": { + "line": 21, + "column": 10 + }, + "end": { + "line": 21, + "column": 35 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 5 + }, + "end": { + "line": 21, + "column": 7 + } + } + }, + "init": null, + "loc": { + "start": { + "line": 21, + "column": 5 + }, + "end": { + "line": 21, + "column": 7 + } + } + } + ], + "kind": "var", + "loc": { + "start": { + "line": 21, + "column": 1 + }, + "end": { + "line": 21, + "column": 36 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ForTupleTest", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 7 + }, + "end": { + "line": 23, + "column": 19 + } + } + }, + "superClass": null, + "implements": [], + "constructor": { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": null, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 1 + }, + "end": { + "line": 24, + "column": 2 + } + } + }, + "body": [], + "indexSignatures": [], + "loc": { + "start": { + "line": 23, + "column": 20 + }, + "end": { + "line": 24, + "column": 2 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 1 + }, + "end": { + "line": 24, + "column": 2 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "x6", + "typeAnnotation": { + "type": "TSTupleType", + "elementTypes": [ + { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ForTupleTest", + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 11 + }, + "end": { + "line": 25, + "column": 23 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 11 + }, + "end": { + "line": 25, + "column": 23 + } + } + }, + { + "type": "TSOptionalType", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ForTupleTest", + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 25 + }, + "end": { + "line": 25, + "column": 37 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 25 + }, + "end": { + "line": 25, + "column": 37 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 25 + }, + "end": { + "line": 25, + "column": 38 + } + } + } + ], + "loc": { + "start": { + "line": 25, + "column": 10 + }, + "end": { + "line": 25, + "column": 39 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 5 + }, + "end": { + "line": 25, + "column": 7 + } + } + }, + "init": null, + "loc": { + "start": { + "line": 25, + "column": 5 + }, + "end": { + "line": 25, + "column": 7 + } + } + } + ], + "kind": "var", + "loc": { + "start": { + "line": 25, + "column": 1 + }, + "end": { + "line": 25, + "column": 40 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "x7", + "typeAnnotation": { + "type": "TSTupleType", + "elementTypes": [ + { + "type": "TSNamedTupleMember", + "elementType": { + "type": "TSNumberKeyword", + "loc": { + "start": { + "line": 26, + "column": 15 + }, + "end": { + "line": 26, + "column": 21 + } + } + }, + "label": { + "type": "Identifier", + "name": "a", + "decorators": [], + "loc": { + "start": { + "line": 26, + "column": 11 + }, + "end": { + "line": 26, + "column": 12 + } + } + }, + "loc": { + "start": { + "line": 26, + "column": 11 + }, + "end": { + "line": 26, + "column": 21 + } + } + }, + { + "type": "TSNamedTupleMember", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ForTupleTest", + "decorators": [], + "loc": { + "start": { + "line": 26, + "column": 28 + }, + "end": { + "line": 26, + "column": 40 + } + } + }, + "loc": { + "start": { + "line": 26, + "column": 28 + }, + "end": { + "line": 26, + "column": 40 + } + } + }, + "label": { + "type": "Identifier", + "name": "b", + "decorators": [], + "loc": { + "start": { + "line": 26, + "column": 23 + }, + "end": { + "line": 26, + "column": 24 + } + } + }, + "optional": true, + "loc": { + "start": { + "line": 26, + "column": 23 + }, + "end": { + "line": 26, + "column": 40 + } + } + } + ], + "loc": { + "start": { + "line": 26, + "column": 10 + }, + "end": { + "line": 26, + "column": 41 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 26, + "column": 5 + }, + "end": { + "line": 26, + "column": 7 + } + } + }, + "init": null, + "loc": { + "start": { + "line": 26, + "column": 5 + }, + "end": { + "line": 26, + "column": 7 + } + } + } + ], + "kind": "var", + "loc": { + "start": { + "line": 26, + "column": 1 + }, + "end": { + "line": 26, + "column": 42 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "x8", + "typeAnnotation": { + "type": "TSTupleType", + "elementTypes": [ + { + "type": "TSNumberKeyword", + "loc": { + "start": { + "line": 27, + "column": 11 + }, + "end": { + "line": 27, + "column": 17 + } + } + }, + { + "type": "TSRestType", + "typeAnnotation": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ForTupleTest", + "decorators": [], + "loc": { + "start": { + "line": 27, + "column": 22 + }, + "end": { + "line": 27, + "column": 34 + } + } + }, + "loc": { + "start": { + "line": 27, + "column": 22 + }, + "end": { + "line": 27, + "column": 34 + } + } + }, + "loc": { + "start": { + "line": 27, + "column": 22 + }, + "end": { + "line": 27, + "column": 36 + } + } + }, + "loc": { + "start": { + "line": 27, + "column": 19 + }, + "end": { + "line": 27, + "column": 36 + } + } + }, + { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 27, + "column": 38 + }, + "end": { + "line": 27, + "column": 44 + } + } + } + ], + "loc": { + "start": { + "line": 27, + "column": 10 + }, + "end": { + "line": 27, + "column": 45 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 27, + "column": 5 + }, + "end": { + "line": 27, + "column": 7 + } + } + }, + "init": null, + "loc": { + "start": { + "line": 27, + "column": 5 + }, + "end": { + "line": 27, + "column": 7 + } + } + } + ], + "kind": "var", + "loc": { + "start": { + "line": 27, + "column": 1 + }, + "end": { + "line": 27, + "column": 46 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "x9", + "typeAnnotation": { + "type": "TSTupleType", + "elementTypes": [ + { + "type": "TSNamedTupleMember", + "elementType": { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 28, + "column": 15 + }, + "end": { + "line": 28, + "column": 21 + } + } + }, + "label": { + "type": "Identifier", + "name": "a", + "decorators": [], + "loc": { + "start": { + "line": 28, + "column": 11 + }, + "end": { + "line": 28, + "column": 12 + } + } + }, + "loc": { + "start": { + "line": 28, + "column": 11 + }, + "end": { + "line": 28, + "column": 21 + } + } + }, + { + "type": "TSNamedTupleMember", + "elementType": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "C", + "decorators": [], + "loc": { + "start": { + "line": 28, + "column": 30 + }, + "end": { + "line": 28, + "column": 31 + } + } + }, + "loc": { + "start": { + "line": 28, + "column": 30 + }, + "end": { + "line": 28, + "column": 31 + } + } + }, + "loc": { + "start": { + "line": 28, + "column": 30 + }, + "end": { + "line": 28, + "column": 33 + } + } + }, + "label": { + "type": "Identifier", + "name": "b", + "decorators": [], + "loc": { + "start": { + "line": 28, + "column": 26 + }, + "end": { + "line": 28, + "column": 27 + } + } + }, + "rest": true, + "loc": { + "start": { + "line": 28, + "column": 23 + }, + "end": { + "line": 28, + "column": 33 + } + } + }, + { + "type": "TSNamedTupleMember", + "elementType": { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 28, + "column": 37 + }, + "end": { + "line": 28, + "column": 43 + } + } + }, + "label": { + "type": "Identifier", + "name": "c", + "decorators": [], + "loc": { + "start": { + "line": 28, + "column": 35 + }, + "end": { + "line": 28, + "column": 36 + } + } + }, + "loc": { + "start": { + "line": 28, + "column": 35 + }, + "end": { + "line": 28, + "column": 43 + } + } + } + ], + "loc": { + "start": { + "line": 28, + "column": 10 + }, + "end": { + "line": 28, + "column": 44 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 28, + "column": 5 + }, + "end": { + "line": 28, + "column": 7 + } + } + }, + "init": null, + "loc": { + "start": { + "line": 28, + "column": 5 + }, + "end": { + "line": 28, + "column": 7 + } + } + } + ], + "kind": "var", + "loc": { + "start": { + "line": 28, + "column": 1 + }, + "end": { + "line": 28, + "column": 45 + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "id": { + "type": "Identifier", + "name": "StringsForTupleTest", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 6 + }, + "end": { + "line": 30, + "column": 25 + } + } + }, + "typeAnnotation": { + "type": "TSTupleType", + "elementTypes": [ + { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 30, + "column": 29 + }, + "end": { + "line": 30, + "column": 35 + } + } + }, + { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 30, + "column": 37 + }, + "end": { + "line": 30, + "column": 43 + } + } + } + ], + "loc": { + "start": { + "line": 30, + "column": 28 + }, + "end": { + "line": 30, + "column": 44 + } + } + }, + "loc": { + "start": { + "line": 30, + "column": 1 + }, + "end": { + "line": 31, + "column": 5 + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "id": { + "type": "Identifier", + "name": "NumbersForTupleTest", + "decorators": [], + "loc": { + "start": { + "line": 31, + "column": 6 + }, + "end": { + "line": 31, + "column": 25 + } + } + }, + "typeAnnotation": { + "type": "TSTupleType", + "elementTypes": [ + { + "type": "TSNumberKeyword", + "loc": { + "start": { + "line": 31, + "column": 29 + }, + "end": { + "line": 31, + "column": 35 + } + } + }, + { + "type": "TSNumberKeyword", + "loc": { + "start": { + "line": 31, + "column": 37 + }, + "end": { + "line": 31, + "column": 43 + } + } + } + ], + "loc": { + "start": { + "line": 31, + "column": 28 + }, + "end": { + "line": 31, + "column": 44 + } + } + }, + "loc": { + "start": { + "line": 31, + "column": 1 + }, + "end": { + "line": 32, + "column": 5 + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "id": { + "type": "Identifier", + "name": "x10", + "decorators": [], + "loc": { + "start": { + "line": 32, + "column": 6 + }, + "end": { + "line": 32, + "column": 9 + } + } + }, + "typeAnnotation": { + "type": "TSTupleType", + "elementTypes": [ + { + "type": "TSRestType", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "StringsForTupleTest", + "decorators": [], + "loc": { + "start": { + "line": 32, + "column": 16 + }, + "end": { + "line": 32, + "column": 35 + } + } + }, + "loc": { + "start": { + "line": 32, + "column": 16 + }, + "end": { + "line": 32, + "column": 35 + } + } + }, + "loc": { + "start": { + "line": 32, + "column": 13 + }, + "end": { + "line": 32, + "column": 35 + } + } + }, + { + "type": "TSRestType", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "NumbersForTupleTest", + "decorators": [], + "loc": { + "start": { + "line": 32, + "column": 40 + }, + "end": { + "line": 32, + "column": 59 + } + } + }, + "loc": { + "start": { + "line": 32, + "column": 40 + }, + "end": { + "line": 32, + "column": 59 + } + } + }, + "loc": { + "start": { + "line": 32, + "column": 37 + }, + "end": { + "line": 32, + "column": 59 + } + } + } + ], + "loc": { + "start": { + "line": 32, + "column": 12 + }, + "end": { + "line": 32, + "column": 60 + } + } + }, + "loc": { + "start": { + "line": 32, + "column": 1 + }, + "end": { + "line": 33, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 33, + "column": 1 + } + } +} diff --git a/es2panda/test/parser/ts/test-tuple-type5.ts b/es2panda/test/parser/ts/test-tuple-type5.ts new file mode 100644 index 0000000000..9fa1dd4432 --- /dev/null +++ b/es2panda/test/parser/ts/test-tuple-type5.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +var x1 : [number, string]; +var x2 : [string, ...number[], string]; +var x3 : [a : boolean, ...b :string[], c : number]; +var x4 : [string, number?]; +var x5 : [a : number, b ?: string]; + +class ForTupleTest { +} +var x6 : [ForTupleTest, ForTupleTest?]; +var x7 : [a : number, b ?: ForTupleTest]; +var x8 : [number, ...ForTupleTest[], string]; +var x9 : [a : string, ...b : C[], c:string]; + +type StringsForTupleTest = [string, string] +type NumbersForTupleTest = [number, number] +type x10 = [...StringsForTupleTest, ...NumbersForTupleTest] diff --git a/es2panda/test/parser/ts/test_generic-expected.txt b/es2panda/test/parser/ts/test_generic-expected.txt index 6618f07c9d..854d904212 100644 --- a/es2panda/test/parser/ts/test_generic-expected.txt +++ b/es2panda/test/parser/ts/test_generic-expected.txt @@ -833,7 +833,7 @@ }, "end": { "line": 23, - "column": 75 + "column": 74 } } }, @@ -846,7 +846,7 @@ }, "end": { "line": 23, - "column": 83 + "column": 82 } } } @@ -1633,7 +1633,7 @@ }, "end": { "line": 29, - "column": 31 + "column": 30 } } }, @@ -1646,7 +1646,7 @@ }, "end": { "line": 29, - "column": 39 + "column": 38 } } } @@ -1900,7 +1900,7 @@ }, "end": { "line": 36, - "column": 44 + "column": 43 } } }, @@ -1926,7 +1926,7 @@ }, "end": { "line": 36, - "column": 54 + "column": 53 } } } @@ -2015,7 +2015,7 @@ }, "end": { "line": 34, - "column": 107 + "column": 106 } } }, @@ -2028,7 +2028,7 @@ }, "end": { "line": 34, - "column": 115 + "column": 114 } } } @@ -2114,7 +2114,7 @@ }, "end": { "line": 34, - "column": 40 + "column": 39 } } }, @@ -2127,7 +2127,7 @@ }, "end": { "line": 34, - "column": 48 + "column": 47 } } }, @@ -2230,7 +2230,7 @@ }, "end": { "line": 34, - "column": 74 + "column": 73 } } } @@ -2408,7 +2408,7 @@ }, "end": { "line": 39, - "column": 26 + "column": 25 } } }, @@ -2435,7 +2435,7 @@ }, "end": { "line": 39, - "column": 29 + "column": 28 } } }, @@ -2462,7 +2462,7 @@ }, "end": { "line": 39, - "column": 32 + "column": 31 } } } @@ -4072,7 +4072,7 @@ }, "end": { "line": 53, - "column": 54 + "column": 53 } } } @@ -4513,7 +4513,7 @@ }, "end": { "line": 57, - "column": 75 + "column": 74 } } } @@ -5680,7 +5680,7 @@ }, "end": { "line": 65, - "column": 52 + "column": 51 } } }, @@ -5693,7 +5693,7 @@ }, "end": { "line": 65, - "column": 60 + "column": 59 } } } @@ -6391,7 +6391,7 @@ }, "end": { "line": 69, - "column": 23 + "column": 22 } } }, @@ -6404,7 +6404,7 @@ }, "end": { "line": 69, - "column": 31 + "column": 30 } } }, @@ -6417,7 +6417,7 @@ }, "end": { "line": 69, - "column": 39 + "column": 38 } } } @@ -6906,7 +6906,7 @@ }, "end": { "line": 74, - "column": 34 + "column": 33 } } }, @@ -6919,7 +6919,7 @@ }, "end": { "line": 74, - "column": 42 + "column": 41 } } } diff --git a/es2panda/test/parser/ts/test_import_type-expected.txt b/es2panda/test/parser/ts/test_import_type-expected.txt index 1f19c1b27a..7edda133f4 100644 --- a/es2panda/test/parser/ts/test_import_type-expected.txt +++ b/es2panda/test/parser/ts/test_import_type-expected.txt @@ -605,7 +605,7 @@ }, "end": { "line": 24, - "column": 104 + "column": 103 } } }, @@ -618,7 +618,7 @@ }, "end": { "line": 24, - "column": 112 + "column": 111 } } } diff --git a/es2panda/test/parser/ts/test_this_type-expected.txt b/es2panda/test/parser/ts/test_this_type-expected.txt index df31b0ada7..86ddf76c31 100644 --- a/es2panda/test/parser/ts/test_this_type-expected.txt +++ b/es2panda/test/parser/ts/test_this_type-expected.txt @@ -313,7 +313,7 @@ }, "end": { "line": 22, - "column": 40 + "column": 39 } } }, @@ -327,7 +327,7 @@ }, "end": { "line": 22, - "column": 44 + "column": 43 } } } diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructuring-expected.txt index ae094194a0..7bc3d54070 100644 --- a/es2panda/test/parser/ts/type_checker/arrayDestructuring-expected.txt +++ b/es2panda/test/parser/ts/type_checker/arrayDestructuring-expected.txt @@ -2607,7 +2607,7 @@ }, "end": { "line": 45, - "column": 40 + "column": 39 } } }, @@ -2620,7 +2620,7 @@ }, "end": { "line": 45, - "column": 48 + "column": 47 } } } @@ -2766,7 +2766,7 @@ }, "end": { "line": 47, - "column": 40 + "column": 39 } } }, @@ -2807,7 +2807,7 @@ }, "end": { "line": 47, - "column": 57 + "column": 56 } } }, @@ -2833,7 +2833,7 @@ }, "end": { "line": 47, - "column": 68 + "column": 67 } } } @@ -3063,7 +3063,7 @@ }, "end": { "line": 48, - "column": 42 + "column": 41 } } }, @@ -3076,7 +3076,7 @@ }, "end": { "line": 48, - "column": 50 + "column": 49 } } }, @@ -3089,7 +3089,7 @@ }, "end": { "line": 48, - "column": 58 + "column": 57 } } } @@ -3410,7 +3410,7 @@ }, "end": { "line": 49, - "column": 77 + "column": 76 } } }, @@ -3567,7 +3567,7 @@ }, "end": { "line": 49, - "column": 117 + "column": 116 } } } @@ -4048,7 +4048,7 @@ }, "end": { "line": 50, - "column": 81 + "column": 80 } } }, @@ -4062,7 +4062,7 @@ }, "end": { "line": 50, - "column": 85 + "column": 84 } } } @@ -4074,7 +4074,7 @@ }, "end": { "line": 50, - "column": 86 + "column": 85 } } }, @@ -4093,7 +4093,7 @@ }, "end": { "line": 50, - "column": 96 + "column": 95 } } } @@ -4105,7 +4105,7 @@ }, "end": { "line": 50, - "column": 97 + "column": 96 } } } @@ -4117,7 +4117,7 @@ }, "end": { "line": 50, - "column": 98 + "column": 97 } } } @@ -4436,7 +4436,7 @@ }, "end": { "line": 51, - "column": 44 + "column": 43 } } }, @@ -4495,7 +4495,7 @@ }, "end": { "line": 51, - "column": 63 + "column": 62 } } }, @@ -4508,7 +4508,7 @@ }, "end": { "line": 51, - "column": 71 + "column": 70 } } }, @@ -4521,7 +4521,7 @@ }, "end": { "line": 51, - "column": 79 + "column": 78 } } } diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring12-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructuring12-expected.txt index 17ef89fd5c..d34db2bbe1 100644 --- a/es2panda/test/parser/ts/type_checker/arrayDestructuring12-expected.txt +++ b/es2panda/test/parser/ts/type_checker/arrayDestructuring12-expected.txt @@ -95,7 +95,7 @@ }, "end": { "line": 17, - "column": 28 + "column": 27 } } }, @@ -108,7 +108,7 @@ }, "end": { "line": 17, - "column": 36 + "column": 35 } } }, @@ -121,7 +121,7 @@ }, "end": { "line": 17, - "column": 45 + "column": 44 } } } diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring13-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructuring13-expected.txt index c618887393..0761baa416 100644 --- a/es2panda/test/parser/ts/type_checker/arrayDestructuring13-expected.txt +++ b/es2panda/test/parser/ts/type_checker/arrayDestructuring13-expected.txt @@ -21,7 +21,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } }, @@ -34,7 +34,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 23 } } }, @@ -47,7 +47,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } } diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring15-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructuring15-expected.txt index cb1ccc7a92..941bcf4a45 100644 --- a/es2panda/test/parser/ts/type_checker/arrayDestructuring15-expected.txt +++ b/es2panda/test/parser/ts/type_checker/arrayDestructuring15-expected.txt @@ -21,7 +21,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } } diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring16-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructuring16-expected.txt index 0a708c25c2..261780eec2 100644 --- a/es2panda/test/parser/ts/type_checker/arrayDestructuring16-expected.txt +++ b/es2panda/test/parser/ts/type_checker/arrayDestructuring16-expected.txt @@ -21,7 +21,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } } diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring17-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructuring17-expected.txt index 20dec895eb..a345589dbb 100644 --- a/es2panda/test/parser/ts/type_checker/arrayDestructuring17-expected.txt +++ b/es2panda/test/parser/ts/type_checker/arrayDestructuring17-expected.txt @@ -93,7 +93,7 @@ }, "end": { "line": 17, - "column": 43 + "column": 42 } } }, @@ -106,7 +106,7 @@ }, "end": { "line": 17, - "column": 51 + "column": 50 } } } diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring18-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructuring18-expected.txt index 77f6869313..0ec15d22da 100644 --- a/es2panda/test/parser/ts/type_checker/arrayDestructuring18-expected.txt +++ b/es2panda/test/parser/ts/type_checker/arrayDestructuring18-expected.txt @@ -53,7 +53,7 @@ }, "end": { "line": 17, - "column": 21 + "column": 20 } } }, @@ -66,7 +66,7 @@ }, "end": { "line": 17, - "column": 29 + "column": 28 } } } @@ -120,7 +120,7 @@ }, "end": { "line": 17, - "column": 52 + "column": 51 } } }, @@ -133,7 +133,7 @@ }, "end": { "line": 17, - "column": 58 + "column": 57 } } }, @@ -147,7 +147,7 @@ }, "end": { "line": 17, - "column": 62 + "column": 61 } } } diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring19-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructuring19-expected.txt index 206661a324..0fd5d2daa3 100644 --- a/es2panda/test/parser/ts/type_checker/arrayDestructuring19-expected.txt +++ b/es2panda/test/parser/ts/type_checker/arrayDestructuring19-expected.txt @@ -68,7 +68,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 23 } } }, @@ -81,7 +81,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } } @@ -135,7 +135,7 @@ }, "end": { "line": 17, - "column": 55 + "column": 54 } } }, @@ -148,7 +148,7 @@ }, "end": { "line": 17, - "column": 61 + "column": 60 } } }, @@ -162,7 +162,7 @@ }, "end": { "line": 17, - "column": 65 + "column": 64 } } } diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring27-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructuring27-expected.txt index 34f429253f..1ca9df943f 100644 --- a/es2panda/test/parser/ts/type_checker/arrayDestructuring27-expected.txt +++ b/es2panda/test/parser/ts/type_checker/arrayDestructuring27-expected.txt @@ -149,7 +149,7 @@ }, "end": { "line": 17, - "column": 41 + "column": 40 } } }, @@ -190,7 +190,7 @@ }, "end": { "line": 17, - "column": 58 + "column": 57 } } } diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring4-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructuring4-expected.txt index fd2657f8e5..4573dc6ff5 100644 --- a/es2panda/test/parser/ts/type_checker/arrayDestructuring4-expected.txt +++ b/es2panda/test/parser/ts/type_checker/arrayDestructuring4-expected.txt @@ -37,7 +37,7 @@ }, "end": { "line": 17, - "column": 18 + "column": 17 } } }, @@ -50,7 +50,7 @@ }, "end": { "line": 17, - "column": 26 + "column": 25 } } } diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring5-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructuring5-expected.txt index d16b14b993..93433e43a4 100644 --- a/es2panda/test/parser/ts/type_checker/arrayDestructuring5-expected.txt +++ b/es2panda/test/parser/ts/type_checker/arrayDestructuring5-expected.txt @@ -106,7 +106,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } }, @@ -119,7 +119,7 @@ }, "end": { "line": 17, - "column": 41 + "column": 40 } } } diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring6-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructuring6-expected.txt index 90445bd028..574169bfdd 100644 --- a/es2panda/test/parser/ts/type_checker/arrayDestructuring6-expected.txt +++ b/es2panda/test/parser/ts/type_checker/arrayDestructuring6-expected.txt @@ -81,7 +81,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } }, @@ -94,7 +94,7 @@ }, "end": { "line": 17, - "column": 40 + "column": 39 } } } diff --git a/es2panda/test/parser/ts/type_checker/functionOverload2-expected.txt b/es2panda/test/parser/ts/type_checker/functionOverload2-expected.txt index e0e28b9775..90dcd0e40c 100644 --- a/es2panda/test/parser/ts/type_checker/functionOverload2-expected.txt +++ b/es2panda/test/parser/ts/type_checker/functionOverload2-expected.txt @@ -93,7 +93,7 @@ }, "end": { "line": 17, - "column": 45 + "column": 44 } } }, @@ -106,7 +106,7 @@ }, "end": { "line": 17, - "column": 53 + "column": 52 } } } @@ -236,7 +236,7 @@ }, "end": { "line": 18, - "column": 46 + "column": 45 } } }, @@ -249,7 +249,7 @@ }, "end": { "line": 18, - "column": 54 + "column": 53 } } } @@ -379,7 +379,7 @@ }, "end": { "line": 19, - "column": 46 + "column": 45 } } }, @@ -392,7 +392,7 @@ }, "end": { "line": 19, - "column": 54 + "column": 53 } } } @@ -591,7 +591,7 @@ }, "end": { "line": 20, - "column": 73 + "column": 72 } } }, @@ -604,7 +604,7 @@ }, "end": { "line": 20, - "column": 81 + "column": 80 } } } diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment-expected.txt b/es2panda/test/parser/ts/type_checker/interfaceAssignment-expected.txt index 8aa74554e2..b07a122969 100644 --- a/es2panda/test/parser/ts/type_checker/interfaceAssignment-expected.txt +++ b/es2panda/test/parser/ts/type_checker/interfaceAssignment-expected.txt @@ -2369,7 +2369,7 @@ }, "end": { "line": 71, - "column": 16 + "column": 15 } } }, @@ -2382,7 +2382,7 @@ }, "end": { "line": 71, - "column": 24 + "column": 23 } } } diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment3-expected.txt b/es2panda/test/parser/ts/type_checker/interfaceAssignment3-expected.txt index 5df9b64a64..689b9ebbe4 100644 --- a/es2panda/test/parser/ts/type_checker/interfaceAssignment3-expected.txt +++ b/es2panda/test/parser/ts/type_checker/interfaceAssignment3-expected.txt @@ -386,7 +386,7 @@ }, "end": { "line": 30, - "column": 16 + "column": 15 } } }, @@ -399,7 +399,7 @@ }, "end": { "line": 30, - "column": 24 + "column": 23 } } } diff --git a/es2panda/test/parser/ts/type_checker/memberExpTests-expected.txt b/es2panda/test/parser/ts/type_checker/memberExpTests-expected.txt index 6f0b1ce2ed..03d7b8e97a 100644 --- a/es2panda/test/parser/ts/type_checker/memberExpTests-expected.txt +++ b/es2panda/test/parser/ts/type_checker/memberExpTests-expected.txt @@ -4677,7 +4677,7 @@ }, "end": { "line": 96, - "column": 36 + "column": 35 } } }, @@ -4690,7 +4690,7 @@ }, "end": { "line": 96, - "column": 44 + "column": 43 } } }, @@ -4703,7 +4703,7 @@ }, "end": { "line": 96, - "column": 52 + "column": 51 } } } diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring23-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestructuring23-expected.txt index 571f0454aa..4c94ce5b0c 100644 --- a/es2panda/test/parser/ts/type_checker/objectDestructuring23-expected.txt +++ b/es2panda/test/parser/ts/type_checker/objectDestructuring23-expected.txt @@ -67,7 +67,7 @@ }, "end": { "line": 17, - "column": 26 + "column": 25 } } }, @@ -80,7 +80,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 33 } } } diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring24-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestructuring24-expected.txt index 927c614e68..876eff3598 100644 --- a/es2panda/test/parser/ts/type_checker/objectDestructuring24-expected.txt +++ b/es2panda/test/parser/ts/type_checker/objectDestructuring24-expected.txt @@ -139,7 +139,7 @@ }, "end": { "line": 17, - "column": 46 + "column": 45 } } }, @@ -165,7 +165,7 @@ }, "end": { "line": 17, - "column": 57 + "column": 56 } } } diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring25-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestructuring25-expected.txt index 6d2874ba30..bb41fbdf51 100644 --- a/es2panda/test/parser/ts/type_checker/objectDestructuring25-expected.txt +++ b/es2panda/test/parser/ts/type_checker/objectDestructuring25-expected.txt @@ -145,7 +145,7 @@ }, "end": { "line": 17, - "column": 50 + "column": 49 } } }, @@ -158,7 +158,7 @@ }, "end": { "line": 17, - "column": 58 + "column": 57 } } } diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssignability-expected.txt index 9d55aed3b3..eeb880e0da 100644 --- a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability-expected.txt +++ b/es2panda/test/parser/ts/type_checker/objectLiteralAssignability-expected.txt @@ -6675,7 +6675,7 @@ }, "end": { "line": 69, - "column": 36 + "column": 35 } } }, @@ -6688,7 +6688,7 @@ }, "end": { "line": 69, - "column": 44 + "column": 43 } } }, @@ -6701,7 +6701,7 @@ }, "end": { "line": 69, - "column": 52 + "column": 51 } } } diff --git a/es2panda/test/parser/ts/type_checker/test-type-literal-expected.txt b/es2panda/test/parser/ts/type_checker/test-type-literal-expected.txt index b982eec261..84cd0798c9 100644 --- a/es2panda/test/parser/ts/type_checker/test-type-literal-expected.txt +++ b/es2panda/test/parser/ts/type_checker/test-type-literal-expected.txt @@ -699,7 +699,7 @@ }, "end": { "line": 19, - "column": 66 + "column": 65 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability-expected.txt index 8225600c82..1dde88edcb 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability-expected.txt @@ -97,7 +97,7 @@ }, "end": { "line": 18, - "column": 18 + "column": 17 } } } @@ -109,7 +109,7 @@ }, "end": { "line": 18, - "column": 19 + "column": 18 } } } @@ -225,7 +225,7 @@ }, "end": { "line": 19, - "column": 21 + "column": 20 } } }, @@ -238,7 +238,7 @@ }, "end": { "line": 19, - "column": 29 + "column": 28 } } }, @@ -251,7 +251,7 @@ }, "end": { "line": 19, - "column": 37 + "column": 36 } } } @@ -395,7 +395,7 @@ }, "end": { "line": 20, - "column": 28 + "column": 27 } } }, @@ -408,7 +408,7 @@ }, "end": { "line": 20, - "column": 36 + "column": 35 } } } @@ -554,7 +554,7 @@ }, "end": { "line": 21, - "column": 25 + "column": 24 } } }, @@ -596,7 +596,7 @@ }, "end": { "line": 21, - "column": 37 + "column": 36 } } } @@ -608,7 +608,7 @@ }, "end": { "line": 21, - "column": 38 + "column": 37 } } }, @@ -652,7 +652,7 @@ }, "end": { "line": 21, - "column": 57 + "column": 56 } } }, @@ -678,7 +678,7 @@ }, "end": { "line": 21, - "column": 67 + "column": 66 } } } @@ -690,7 +690,7 @@ }, "end": { "line": 21, - "column": 68 + "column": 67 } } } @@ -895,7 +895,7 @@ }, "end": { "line": 23, - "column": 21 + "column": 20 } } } @@ -923,7 +923,7 @@ }, "end": { "line": 23, - "column": 32 + "column": 31 } } } @@ -1039,7 +1039,7 @@ }, "end": { "line": 24, - "column": 21 + "column": 20 } } }, @@ -1052,7 +1052,7 @@ }, "end": { "line": 24, - "column": 29 + "column": 28 } } } @@ -1365,7 +1365,7 @@ }, "end": { "line": 25, - "column": 62 + "column": 61 } } }, @@ -1406,7 +1406,7 @@ }, "end": { "line": 25, - "column": 79 + "column": 78 } } } @@ -1626,7 +1626,7 @@ }, "end": { "line": 27, - "column": 21 + "column": 20 } } }, @@ -1667,7 +1667,7 @@ }, "end": { "line": 27, - "column": 38 + "column": 37 } } }, @@ -1708,7 +1708,7 @@ }, "end": { "line": 27, - "column": 56 + "column": 55 } } } @@ -1781,7 +1781,7 @@ }, "end": { "line": 28, - "column": 22 + "column": 21 } } }, @@ -1794,7 +1794,7 @@ }, "end": { "line": 28, - "column": 30 + "column": 29 } } }, @@ -1807,7 +1807,7 @@ }, "end": { "line": 28, - "column": 38 + "column": 37 } } } @@ -1908,7 +1908,7 @@ }, "end": { "line": 29, - "column": 25 + "column": 24 } } }, @@ -1977,7 +1977,7 @@ }, "end": { "line": 29, - "column": 45 + "column": 44 } } }, @@ -2018,7 +2018,7 @@ }, "end": { "line": 29, - "column": 57 + "column": 56 } } } @@ -2119,7 +2119,7 @@ }, "end": { "line": 30, - "column": 25 + "column": 24 } } }, @@ -2160,7 +2160,7 @@ }, "end": { "line": 30, - "column": 36 + "column": 35 } } }, @@ -2201,7 +2201,7 @@ }, "end": { "line": 30, - "column": 48 + "column": 47 } } }, @@ -2243,7 +2243,7 @@ }, "end": { "line": 30, - "column": 57 + "column": 56 } } } @@ -2345,7 +2345,7 @@ }, "end": { "line": 31, - "column": 26 + "column": 25 } } }, @@ -2387,7 +2387,7 @@ }, "end": { "line": 31, - "column": 38 + "column": 37 } } }, @@ -2429,7 +2429,7 @@ }, "end": { "line": 31, - "column": 50 + "column": 49 } } } @@ -2994,7 +2994,7 @@ }, "end": { "line": 40, - "column": 63 + "column": 62 } } }, @@ -3007,7 +3007,7 @@ }, "end": { "line": 40, - "column": 71 + "column": 70 } } } @@ -3046,7 +3046,7 @@ }, "end": { "line": 40, - "column": 72 + "column": 71 } } }, @@ -3092,7 +3092,7 @@ }, "end": { "line": 40, - "column": 88 + "column": 87 } } }, @@ -3147,7 +3147,7 @@ }, "end": { "line": 40, - "column": 103 + "column": 102 } } } @@ -3186,7 +3186,7 @@ }, "end": { "line": 40, - "column": 104 + "column": 103 } } }, @@ -3228,7 +3228,7 @@ }, "end": { "line": 40, - "column": 117 + "column": 116 } } } @@ -4042,7 +4042,7 @@ }, "end": { "line": 47, - "column": 50 + "column": 49 } } }, @@ -4097,7 +4097,7 @@ }, "end": { "line": 47, - "column": 65 + "column": 64 } } } @@ -4136,7 +4136,7 @@ }, "end": { "line": 48, - "column": 26 + "column": 25 } } } @@ -4357,7 +4357,7 @@ }, "end": { "line": 53, - "column": 30 + "column": 29 } } }, @@ -4385,7 +4385,7 @@ }, "end": { "line": 53, - "column": 45 + "column": 44 } } }, @@ -4398,7 +4398,7 @@ }, "end": { "line": 53, - "column": 53 + "column": 52 } } } @@ -4532,7 +4532,7 @@ }, "end": { "line": 55, - "column": 47 + "column": 46 } } }, @@ -4545,7 +4545,7 @@ }, "end": { "line": 55, - "column": 56 + "column": 55 } } } @@ -4602,7 +4602,7 @@ }, "end": { "line": 55, - "column": 73 + "column": 72 } } }, @@ -4615,7 +4615,7 @@ }, "end": { "line": 55, - "column": 81 + "column": 80 } } } @@ -5502,7 +5502,7 @@ }, "end": { "line": 66, - "column": 22 + "column": 21 } } }, @@ -5515,7 +5515,7 @@ }, "end": { "line": 66, - "column": 30 + "column": 29 } } } @@ -5543,7 +5543,7 @@ }, "end": { "line": 66, - "column": 41 + "column": 40 } } }, @@ -5556,7 +5556,7 @@ }, "end": { "line": 66, - "column": 49 + "column": 48 } } } @@ -5669,7 +5669,7 @@ }, "end": { "line": 67, - "column": 25 + "column": 24 } } }, @@ -5710,7 +5710,7 @@ }, "end": { "line": 67, - "column": 36 + "column": 35 } } }, @@ -5752,7 +5752,7 @@ }, "end": { "line": 67, - "column": 49 + "column": 48 } } } @@ -5897,7 +5897,7 @@ }, "end": { "line": 68, - "column": 51 + "column": 50 } } }, @@ -5938,7 +5938,7 @@ }, "end": { "line": 68, - "column": 62 + "column": 61 } } } @@ -6023,7 +6023,7 @@ }, "end": { "line": 69, - "column": 22 + "column": 21 } } }, @@ -6036,7 +6036,7 @@ }, "end": { "line": 69, - "column": 30 + "column": 29 } } } @@ -6226,7 +6226,7 @@ }, "end": { "line": 73, - "column": 22 + "column": 21 } } }, @@ -6239,7 +6239,7 @@ }, "end": { "line": 73, - "column": 30 + "column": 29 } } }, @@ -6252,7 +6252,7 @@ }, "end": { "line": 73, - "column": 38 + "column": 37 } } } @@ -6280,7 +6280,7 @@ }, "end": { "line": 73, - "column": 49 + "column": 48 } } }, @@ -6293,7 +6293,7 @@ }, "end": { "line": 73, - "column": 57 + "column": 56 } } }, @@ -6306,7 +6306,7 @@ }, "end": { "line": 73, - "column": 65 + "column": 64 } } }, @@ -6319,7 +6319,7 @@ }, "end": { "line": 73, - "column": 73 + "column": 72 } } } @@ -6700,7 +6700,7 @@ }, "end": { "line": 77, - "column": 49 + "column": 48 } } }, @@ -6713,7 +6713,7 @@ }, "end": { "line": 77, - "column": 57 + "column": 56 } } } @@ -6725,7 +6725,7 @@ }, "end": { "line": 77, - "column": 58 + "column": 57 } } }, @@ -6741,7 +6741,7 @@ }, "end": { "line": 77, - "column": 67 + "column": 66 } } }, @@ -6754,7 +6754,7 @@ }, "end": { "line": 77, - "column": 75 + "column": 74 } } } @@ -6766,7 +6766,7 @@ }, "end": { "line": 77, - "column": 76 + "column": 75 } } } @@ -7251,7 +7251,7 @@ }, "end": { "line": 82, - "column": 33 + "column": 32 } } }, @@ -7264,7 +7264,7 @@ }, "end": { "line": 82, - "column": 41 + "column": 40 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability10-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability10-expected.txt index fab701bc9e..8e0a7ec1e5 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability10-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability10-expected.txt @@ -36,7 +36,7 @@ }, "end": { "line": 17, - "column": 23 + "column": 22 } } }, @@ -49,7 +49,7 @@ }, "end": { "line": 17, - "column": 31 + "column": 30 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability11-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability11-expected.txt index 2a4a99e04d..232430f442 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability11-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability11-expected.txt @@ -81,7 +81,7 @@ }, "end": { "line": 18, - "column": 12 + "column": 11 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability12-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability12-expected.txt index e930d5c202..d3e876743b 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability12-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability12-expected.txt @@ -49,7 +49,7 @@ }, "end": { "line": 17, - "column": 19 + "column": 18 } } }, @@ -90,7 +90,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 29 } } }, @@ -132,7 +132,7 @@ }, "end": { "line": 17, - "column": 42 + "column": 41 } } } @@ -233,7 +233,7 @@ }, "end": { "line": 18, - "column": 19 + "column": 18 } } }, @@ -274,7 +274,7 @@ }, "end": { "line": 18, - "column": 30 + "column": 29 } } }, @@ -315,7 +315,7 @@ }, "end": { "line": 18, - "column": 41 + "column": 40 } } }, @@ -356,7 +356,7 @@ }, "end": { "line": 18, - "column": 52 + "column": 51 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability13-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability13-expected.txt index 229790ab7a..5a43e0365c 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability13-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability13-expected.txt @@ -21,7 +21,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } }, @@ -34,7 +34,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 23 } } }, @@ -47,7 +47,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability15-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability15-expected.txt index d58442c37c..b9946ff2a9 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability15-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability15-expected.txt @@ -21,7 +21,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } }, @@ -34,7 +34,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 23 } } }, @@ -47,7 +47,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability16-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability16-expected.txt index 9c79280695..c6e240b9bf 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability16-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability16-expected.txt @@ -34,7 +34,7 @@ }, "end": { "line": 17, - "column": 18 + "column": 17 } } }, @@ -60,7 +60,7 @@ }, "end": { "line": 17, - "column": 28 + "column": 27 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability17-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability17-expected.txt index 7bfefd46a3..ecb4531cdb 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability17-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability17-expected.txt @@ -21,7 +21,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } }, @@ -34,7 +34,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 23 } } } @@ -237,7 +237,7 @@ }, "end": { "line": 19, - "column": 26 + "column": 25 } } }, @@ -250,7 +250,7 @@ }, "end": { "line": 19, - "column": 34 + "column": 33 } } }, @@ -263,7 +263,7 @@ }, "end": { "line": 19, - "column": 42 + "column": 41 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability18-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability18-expected.txt index a5cbc53f9a..6b78712229 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability18-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability18-expected.txt @@ -54,7 +54,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } }, @@ -96,7 +96,7 @@ }, "end": { "line": 16, - "column": 36 + "column": 35 } } } @@ -135,7 +135,7 @@ }, "end": { "line": 16, - "column": 37 + "column": 36 } } }, @@ -181,7 +181,7 @@ }, "end": { "line": 16, - "column": 59 + "column": 58 } } } @@ -220,7 +220,7 @@ }, "end": { "line": 16, - "column": 60 + "column": 59 } } }, @@ -277,7 +277,7 @@ }, "end": { "line": 16, - "column": 74 + "column": 73 } } } @@ -502,7 +502,7 @@ }, "end": { "line": 17, - "column": 18 + "column": 17 } } } @@ -514,7 +514,7 @@ }, "end": { "line": 17, - "column": 19 + "column": 18 } } } @@ -526,7 +526,7 @@ }, "end": { "line": 17, - "column": 20 + "column": 19 } } } @@ -671,7 +671,7 @@ }, "end": { "line": 19, - "column": 46 + "column": 45 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability19-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability19-expected.txt index e9d768f19e..f314840647 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability19-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability19-expected.txt @@ -24,7 +24,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } } @@ -52,7 +52,7 @@ }, "end": { "line": 17, - "column": 27 + "column": 26 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability2-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability2-expected.txt index 8995836528..88719da8e3 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability2-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability2-expected.txt @@ -21,7 +21,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } }, @@ -34,7 +34,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 23 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability20-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability20-expected.txt index 7ff77df587..d04b61cf30 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability20-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability20-expected.txt @@ -50,7 +50,7 @@ }, "end": { "line": 17, - "column": 27 + "column": 26 } } }, @@ -63,7 +63,7 @@ }, "end": { "line": 17, - "column": 35 + "column": 34 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability21-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability21-expected.txt index 06397b7a4d..31da016982 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability21-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability21-expected.txt @@ -24,7 +24,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } }, @@ -37,7 +37,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 23 } } } @@ -65,7 +65,7 @@ }, "end": { "line": 17, - "column": 35 + "column": 34 } } }, @@ -78,7 +78,7 @@ }, "end": { "line": 17, - "column": 43 + "column": 42 } } }, @@ -91,7 +91,7 @@ }, "end": { "line": 17, - "column": 51 + "column": 50 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability22-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability22-expected.txt index 5b2bb31018..d20f35f39f 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability22-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability22-expected.txt @@ -24,7 +24,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } }, @@ -37,7 +37,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 23 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability23-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability23-expected.txt index 376f24f06b..ffbdad77cb 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability23-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability23-expected.txt @@ -24,7 +24,7 @@ }, "end": { "line": 17, - "column": 17 + "column": 16 } } }, @@ -37,7 +37,7 @@ }, "end": { "line": 17, - "column": 25 + "column": 24 } } } @@ -49,7 +49,7 @@ }, "end": { "line": 17, - "column": 26 + "column": 25 } } }, @@ -65,7 +65,7 @@ }, "end": { "line": 17, - "column": 35 + "column": 34 } } }, @@ -78,7 +78,7 @@ }, "end": { "line": 17, - "column": 43 + "column": 42 } } } @@ -90,7 +90,7 @@ }, "end": { "line": 17, - "column": 44 + "column": 43 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability24-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability24-expected.txt index b048ecbd21..10a93bc586 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability24-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability24-expected.txt @@ -24,7 +24,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } }, @@ -37,7 +37,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 23 } } }, @@ -50,7 +50,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } } @@ -164,7 +164,7 @@ }, "end": { "line": 18, - "column": 16 + "column": 15 } } }, @@ -177,7 +177,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 23 } } }, @@ -190,7 +190,7 @@ }, "end": { "line": 18, - "column": 32 + "column": 31 } } }, @@ -203,7 +203,7 @@ }, "end": { "line": 18, - "column": 40 + "column": 39 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability3-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability3-expected.txt index 90960da60e..a1b5c6b9e0 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability3-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability3-expected.txt @@ -21,7 +21,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } }, @@ -34,7 +34,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 23 } } }, @@ -47,7 +47,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability4-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability4-expected.txt index 5bb14fc852..eefbe2fc77 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability4-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability4-expected.txt @@ -21,7 +21,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } }, @@ -34,7 +34,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 23 } } } @@ -107,7 +107,7 @@ }, "end": { "line": 18, - "column": 16 + "column": 15 } } }, @@ -120,7 +120,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 23 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability5-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability5-expected.txt index 519b07fa0d..7e72bd6578 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability5-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability5-expected.txt @@ -21,7 +21,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } }, @@ -34,7 +34,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 23 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability6-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability6-expected.txt index 3bc4258f37..bb5579aac6 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability6-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability6-expected.txt @@ -52,7 +52,7 @@ }, "end": { "line": 17, - "column": 20 + "column": 19 } } }, @@ -94,7 +94,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } } @@ -106,7 +106,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } }, @@ -150,7 +150,7 @@ }, "end": { "line": 17, - "column": 52 + "column": 51 } } }, @@ -176,7 +176,7 @@ }, "end": { "line": 17, - "column": 62 + "column": 61 } } } @@ -188,7 +188,7 @@ }, "end": { "line": 17, - "column": 63 + "column": 62 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability7-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability7-expected.txt index 25e8e2aad4..efcfc4bcf1 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability7-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability7-expected.txt @@ -52,7 +52,7 @@ }, "end": { "line": 17, - "column": 20 + "column": 19 } } }, @@ -94,7 +94,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } } @@ -106,7 +106,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } }, @@ -150,7 +150,7 @@ }, "end": { "line": 17, - "column": 52 + "column": 51 } } }, @@ -176,7 +176,7 @@ }, "end": { "line": 17, - "column": 62 + "column": 61 } } } @@ -188,7 +188,7 @@ }, "end": { "line": 17, - "column": 63 + "column": 62 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability8-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability8-expected.txt index dc38074f31..635194598f 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability8-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability8-expected.txt @@ -21,7 +21,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } }, @@ -34,7 +34,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 23 } } }, @@ -47,7 +47,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } }, @@ -60,7 +60,7 @@ }, "end": { "line": 17, - "column": 41 + "column": 40 } } }, @@ -73,7 +73,7 @@ }, "end": { "line": 17, - "column": 49 + "column": 48 } } } diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability9-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability9-expected.txt index 7cc4abea32..de9f2473eb 100644 --- a/es2panda/test/parser/ts/type_checker/tupleAssignability9-expected.txt +++ b/es2panda/test/parser/ts/type_checker/tupleAssignability9-expected.txt @@ -21,7 +21,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } }, @@ -34,7 +34,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 23 } } } @@ -122,7 +122,7 @@ }, "end": { "line": 19, - "column": 23 + "column": 22 } } }, @@ -135,7 +135,7 @@ }, "end": { "line": 19, - "column": 31 + "column": 30 } } } diff --git a/es2panda/test/parser/ts/type_checker/typeAliasUsedAsValue-expected.txt b/es2panda/test/parser/ts/type_checker/typeAliasUsedAsValue-expected.txt index 1e0d42f3ff..641a5c0e37 100644 --- a/es2panda/test/parser/ts/type_checker/typeAliasUsedAsValue-expected.txt +++ b/es2panda/test/parser/ts/type_checker/typeAliasUsedAsValue-expected.txt @@ -149,7 +149,7 @@ }, "end": { "line": 17, - "column": 55 + "column": 54 } } }, @@ -162,7 +162,7 @@ }, "end": { "line": 17, - "column": 63 + "column": 62 } } }, @@ -175,7 +175,7 @@ }, "end": { "line": 17, - "column": 71 + "column": 70 } } } diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration-expected.txt index a18fe84cd5..9f3c7ef5c2 100644 --- a/es2panda/test/parser/ts/type_checker/varRedeclaration-expected.txt +++ b/es2panda/test/parser/ts/type_checker/varRedeclaration-expected.txt @@ -5575,7 +5575,7 @@ }, "end": { "line": 94, - "column": 19 + "column": 18 } } }, @@ -5616,7 +5616,7 @@ }, "end": { "line": 94, - "column": 30 + "column": 29 } } }, @@ -5657,7 +5657,7 @@ }, "end": { "line": 94, - "column": 42 + "column": 41 } } } @@ -5730,7 +5730,7 @@ }, "end": { "line": 95, - "column": 16 + "column": 15 } } }, @@ -5743,7 +5743,7 @@ }, "end": { "line": 95, - "column": 24 + "column": 23 } } }, @@ -5756,7 +5756,7 @@ }, "end": { "line": 95, - "column": 33 + "column": 32 } } } @@ -5872,7 +5872,7 @@ }, "end": { "line": 97, - "column": 22 + "column": 21 } } }, @@ -5899,7 +5899,7 @@ }, "end": { "line": 97, - "column": 25 + "column": 24 } } }, @@ -5926,7 +5926,7 @@ }, "end": { "line": 97, - "column": 28 + "column": 27 } } } @@ -6028,7 +6028,7 @@ }, "end": { "line": 98, - "column": 11 + "column": 10 } } }, @@ -6055,7 +6055,7 @@ }, "end": { "line": 98, - "column": 14 + "column": 13 } } }, @@ -6082,7 +6082,7 @@ }, "end": { "line": 98, - "column": 17 + "column": 16 } } } diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration6-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration6-expected.txt index 9619ac59c8..99b307b72e 100644 --- a/es2panda/test/parser/ts/type_checker/varRedeclaration6-expected.txt +++ b/es2panda/test/parser/ts/type_checker/varRedeclaration6-expected.txt @@ -21,7 +21,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } }, @@ -34,7 +34,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 23 } } }, @@ -47,7 +47,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } } @@ -148,7 +148,7 @@ }, "end": { "line": 18, - "column": 19 + "column": 18 } } }, @@ -189,7 +189,7 @@ }, "end": { "line": 18, - "column": 30 + "column": 29 } } }, @@ -231,7 +231,7 @@ }, "end": { "line": 18, - "column": 42 + "column": 41 } } } diff --git a/es2panda/typescript/checker.h b/es2panda/typescript/checker.h index 734017f290..b2da9878e9 100644 --- a/es2panda/typescript/checker.h +++ b/es2panda/typescript/checker.h @@ -152,6 +152,11 @@ public: return globalTypes_->GlobalStringType(); } + Type *GlobalSymbolType() + { + return globalTypes_->GlobalSymbolType(); + } + Type *GlobalBooleanType() { return globalTypes_->GlobalBooleanType(); diff --git a/es2panda/typescript/types/globalTypesHolder.cpp b/es2panda/typescript/types/globalTypesHolder.cpp index b3078e90bc..3092855603 100644 --- a/es2panda/typescript/types/globalTypesHolder.cpp +++ b/es2panda/typescript/types/globalTypesHolder.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -41,6 +42,7 @@ GlobalTypesHolder::GlobalTypesHolder(ArenaAllocator *allocator) globalTypes_[static_cast(GlobalTypeId::NUMBER)] = allocator->New(); globalTypes_[static_cast(GlobalTypeId::ANY)] = allocator->New(); globalTypes_[static_cast(GlobalTypeId::STRING)] = allocator->New(); + globalTypes_[static_cast(GlobalTypeId::SYMBOL)] = allocator->New(); globalTypes_[static_cast(GlobalTypeId::BOOLEAN)] = allocator->New(); globalTypes_[static_cast(GlobalTypeId::VOID)] = allocator->New(); globalTypes_[static_cast(GlobalTypeId::NULL_ID)] = allocator->New(); @@ -61,7 +63,7 @@ GlobalTypesHolder::GlobalTypesHolder(ArenaAllocator *allocator) globalTypes_[static_cast(GlobalTypeId::PRIMITIVE)] = allocator->New( allocator, std::initializer_list {GlobalNumberType(), GlobalStringType(), GlobalBigintType(), GlobalBooleanType(), - GlobalVoidType(), GlobalUndefinedType(), GlobalNullType()}); + GlobalVoidType(), GlobalUndefinedType(), GlobalNullType(), GlobalSymbolType()}); globalTypes_[static_cast(GlobalTypeId::EMPTY_TUPLE)] = allocator->New(allocator); globalTypes_[static_cast(GlobalTypeId::EMPTY_OBJECT)] = allocator->New(); globalTypes_[static_cast(GlobalTypeId::RESOLVING_RETURN_TYPE)] = allocator->New(); @@ -83,6 +85,11 @@ Type *GlobalTypesHolder::GlobalStringType() return globalTypes_.at(static_cast(GlobalTypeId::STRING)); } +Type *GlobalTypesHolder::GlobalSymbolType() +{ + return globalTypes_.at(static_cast(GlobalTypeId::SYMBOL)); +} + Type *GlobalTypesHolder::GlobalBooleanType() { return globalTypes_.at(static_cast(GlobalTypeId::BOOLEAN)); diff --git a/es2panda/typescript/types/globalTypesHolder.h b/es2panda/typescript/types/globalTypesHolder.h index fefecfa2e5..68b13c3537 100644 --- a/es2panda/typescript/types/globalTypesHolder.h +++ b/es2panda/typescript/types/globalTypesHolder.h @@ -24,6 +24,7 @@ enum class GlobalTypeId { NUMBER, ANY, STRING, + SYMBOL, BOOLEAN, VOID, NULL_ID, @@ -57,6 +58,7 @@ public: Type *GlobalNumberType(); Type *GlobalAnyType(); Type *GlobalStringType(); + Type *GlobalSymbolType(); Type *GlobalBooleanType(); Type *GlobalVoidType(); Type *GlobalNullType(); diff --git a/es2panda/typescript/types/symbolType.cpp b/es2panda/typescript/types/symbolType.cpp new file mode 100644 index 0000000000..65d1ce5fe3 --- /dev/null +++ b/es2panda/typescript/types/symbolType.cpp @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "symbolType.h" + +namespace panda::es2panda::checker { + +void SymbolType::ToString(std::stringstream &ss) const +{ + ss << "symbol"; +} + +void SymbolType::Identical(TypeRelation *relation, Type *other) +{ + if (other->IsSymbolType()) { + relation->Result(true); + } +} + +void SymbolType::AssignmentTarget(TypeRelation *relation, Type *source) +{ + if (source->IsSymbolType()) { + relation->Result(true); + } +} + +TypeFacts SymbolType::GetTypeFacts() const +{ + return TypeFacts::SYMBOL_FACTS; +} + +Type *SymbolType::Instantiate([[maybe_unused]] ArenaAllocator *allocator, [[maybe_unused]] TypeRelation *relation, + [[maybe_unused]] GlobalTypesHolder *globalTypes) +{ + return this; +} + +} // namespace panda::es2panda::checker diff --git a/es2panda/typescript/types/symbolType.h b/es2panda/typescript/types/symbolType.h new file mode 100644 index 0000000000..8ee6484e3c --- /dev/null +++ b/es2panda/typescript/types/symbolType.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ES2PANDA_COMPILER_TYPESCRIPT_TYPES_SYMBOL_TYPE_H +#define ES2PANDA_COMPILER_TYPESCRIPT_TYPES_SYMBOL_TYPE_H + +#include "type.h" + +namespace panda::es2panda::checker { + +class SymbolType : public Type { +public: + SymbolType() : Type(TypeFlag::SYMBOL) {} + + void ToString(std::stringstream &ss) const override; + void Identical(TypeRelation *relation, Type *other) override; + void AssignmentTarget(TypeRelation *relation, Type *source) override; + TypeFacts GetTypeFacts() const override; + Type *Instantiate(ArenaAllocator *allocator, TypeRelation *relation, GlobalTypesHolder *globalTypes) override; +}; + +} // namespace panda::es2panda::checker + +#endif /* TYPESCRIPT_TYPES_STRING_TYPE_H */ diff --git a/es2panda/typescript/types/typeFacts.h b/es2panda/typescript/types/typeFacts.h index 1988b6a09c..165c03fa9b 100644 --- a/es2panda/typescript/types/typeFacts.h +++ b/es2panda/typescript/types/typeFacts.h @@ -68,6 +68,13 @@ enum class TypeFacts { EMPTY_STRING_FACTS = BASE_STRING_FACTS, NON_EMPTY_STRING_FACTS = BASE_STRING_FACTS | TRUTHY, + // Symbol facts + BASE_SYMBOL_STRICT_FACTS = TYPEOF_EQ_SYMBOL | TYPEOF_NE_NUMBER | TYPEOF_NE_BIGINT | TYPEOF_NE_BOOLEAN | + TYPEOF_NE_STRING | TYPEOF_NE_OBJECT | TYPEOF_NE_FUNCTION | TYPEOF_NE_HOST_OBJECT | + NE_UNDEFINED | NE_NULL | NE_UNDEFINED_OR_NULL, + BASE_SYMBOL_FACTS = BASE_SYMBOL_STRICT_FACTS | EQ_UNDEFINED | EQ_NULL | EQ_UNDEFINED_OR_NULL | FALSY, + SYMBOL_FACTS = BASE_SYMBOL_FACTS | TRUTHY, + // Bigint facts BASE_BIGINT_STRICT_FACTS = TYPEOF_EQ_BIGINT | TYPEOF_NE_STRING | TYPEOF_NE_NUMBER | TYPEOF_NE_BOOLEAN | TYPEOF_NE_SYMBOL | TYPEOF_NE_OBJECT | TYPEOF_NE_FUNCTION | TYPEOF_NE_HOST_OBJECT | diff --git a/es2panda/typescript/types/typeMapping.h b/es2panda/typescript/types/typeMapping.h index 85383ee2ae..3ad47aadec 100644 --- a/es2panda/typescript/types/typeMapping.h +++ b/es2panda/typescript/types/typeMapping.h @@ -24,6 +24,7 @@ _(TypeFlag::BIGINT_LITERAL, BigintLiteralType) \ _(TypeFlag::NUMBER, NumberType) \ _(TypeFlag::STRING, StringType) \ + _(TypeFlag::SYMBOL, SymbolType) \ _(TypeFlag::BOOLEAN, BooleanType) \ _(TypeFlag::VOID, VoidType) \ _(TypeFlag::NULL_TYPE, NullType) \ diff --git a/es2panda/typescript/types/types.h b/es2panda/typescript/types/types.h index 7b3d981006..939919f94a 100644 --- a/es2panda/typescript/types/types.h +++ b/es2panda/typescript/types/types.h @@ -36,6 +36,7 @@ #include "objectType.h" #include "stringLiteralType.h" #include "stringType.h" +#include "symbolType.h" #include "tupleType.h" #include "undefinedType.h" #include "unionType.h" -- Gitee From 35216ae5ff583cc395e70779f57a6dd871e7032a Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Tue, 6 Sep 2022 11:04:13 +0800 Subject: [PATCH 06/28] Delete tmp output file path, not emit js file Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I5PW3B?from=project-issue Test: test262, ts2abc ut, ts2abc type test Signed-off-by: zhangrengao Change-Id: I0b23c82973b0f8eb3587c22d8bf5eb827adb246b --- ts2panda/src/cmdOptions.ts | 8 ++++++++ ts2panda/src/index.ts | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ts2panda/src/cmdOptions.ts b/ts2panda/src/cmdOptions.ts index da02f18c62..bf19d72cd5 100644 --- a/ts2panda/src/cmdOptions.ts +++ b/ts2panda/src/cmdOptions.ts @@ -50,6 +50,7 @@ const ts2pandaOptions = [ { name: 'function-sourcecode', type: Boolean, defaultValue: false, description: "Record functions' sourceCode to support the feature of [function].toString()" }, { name: 'expression-watch-toolchain', type: String, defaultValue: "es2panda", description: "Specify the tool chain used to transform the expression" }, { name: 'source-file', type: String, defaultValue: "", description: "specify the file path info recorded in generated abc" }, + { name: 'generate-tmp-file', type: Boolean, defaultValue: false, description: "whether to generate intermediate temporary files"}, ] @@ -307,6 +308,13 @@ export class CmdOptions { return this.options["source-file"]; } + static needGenerateTmpFile(): boolean { + if (!this.options) { + return false; + } + return this.options["generate-tmp-file"]; + } + // @ts-ignore static parseUserCmd(args: string[]): ts.ParsedCommandLine | undefined { this.options = commandLineArgs(ts2pandaOptions, { partial: true }); diff --git a/ts2panda/src/index.ts b/ts2panda/src/index.ts index c7f898b582..e243c78b0d 100644 --- a/ts2panda/src/index.ts +++ b/ts2panda/src/index.ts @@ -52,7 +52,11 @@ function generateDTs(node: ts.SourceFile, options: ts.CompilerOptions) { } function main(fileNames: string[], options: ts.CompilerOptions) { - let program = ts.createProgram(fileNames, options); + const host = ts.createCompilerHost(options); + if (!CmdOptions.needGenerateTmpFile()) { + host.writeFile = () => {}; + } + let program = ts.createProgram(fileNames, options, host); let typeChecker = TypeChecker.getInstance(); typeChecker.setTypeChecker(program.getTypeChecker()); -- Gitee From 621342ee9d788fc50d64b7c630c29e84194fa3d5 Mon Sep 17 00:00:00 2001 From: hufeng Date: Wed, 14 Sep 2022 09:57:04 +0800 Subject: [PATCH 07/28] Fix incorrect LabelTarget's initialization in SwitchStatement Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I5QXOE?from=project-issue Test: test262, UT, type tests Signed-off-by: hufeng Change-Id: I6c615a660c5c27ba73da91baf8ddb49a48aa9aaf --- ts2panda/src/statement/labelTarget.ts | 40 +++++++++++++++-------- ts2panda/src/statement/switchStatement.ts | 9 +---- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/ts2panda/src/statement/labelTarget.ts b/ts2panda/src/statement/labelTarget.ts index 1c6cf17fa8..bfd71326a8 100644 --- a/ts2panda/src/statement/labelTarget.ts +++ b/ts2panda/src/statement/labelTarget.ts @@ -22,9 +22,11 @@ import { Label } from "../irnodes"; export class LabelTarget { private static name2LabelTarget: Map = new Map(); private static labelTargetStack: LabelTarget[] = []; + private static curLoopLabelTarget: LabelTarget | undefined = undefined; private node: ts.Node; private breakTargetLabel: Label; private continueTargetLabel: Label | undefined; + private preLoopLabelTarget: LabelTarget | undefined = undefined; private hasLoopEnv: boolean; private loopEnvLevel: number; private tryStatement: TryStatement | undefined; @@ -36,6 +38,10 @@ export class LabelTarget { this.hasLoopEnv = hasLoopEnv; this.loopEnvLevel = hasLoopEnv ? 1 : 0; this.tryStatement = TryStatement.getCurrentTryStatement(); + if (continueTargetLabel) { + this.preLoopLabelTarget = LabelTarget.curLoopLabelTarget; + LabelTarget.curLoopLabelTarget = this; + } } containLoopEnv() { @@ -58,6 +64,10 @@ export class LabelTarget { return this.tryStatement; } + getPreLoopLabelTarget() { + return this.preLoopLabelTarget; + } + getCorrespondingNode() { return this.node; } @@ -84,15 +94,6 @@ export class LabelTarget { return undefined; } - // this API used for get uplevel continueLabel when compile switchStatement - static getCloseContinueTarget(): Label | undefined { - let labelTarget = LabelTarget.getCloseLabelTarget(); - if (labelTarget) { - return labelTarget.continueTargetLabel; - } - return undefined; - } - static pushLabelTarget(labelTarget: LabelTarget) { if (labelTarget.hasLoopEnv) { if (TryStatement.getCurrentTryStatement()) { @@ -104,11 +105,17 @@ export class LabelTarget { } static popLabelTarget() { - if (!LabelTarget.isLabelTargetsEmpty() && LabelTarget.labelTargetStack.pop().hasLoopEnv) { - if (TryStatement.getCurrentTryStatement()) { - TryStatement.getCurrentTryStatement().decreaseLoopEnvLevel(); + if (!LabelTarget.isLabelTargetsEmpty()) { + let popedLabelTarget = LabelTarget.labelTargetStack.pop(); + if (popedLabelTarget.containLoopEnv()) { + if (TryStatement.getCurrentTryStatement()) { + TryStatement.getCurrentTryStatement().decreaseLoopEnvLevel(); + } + LabelTarget.labelTargetStack.forEach(lt => lt.decreaseLoopEnvLevel()); + } + if (popedLabelTarget.getContinueTargetLabel()) { + LabelTarget.curLoopLabelTarget = popedLabelTarget.getPreLoopLabelTarget(); } - LabelTarget.labelTargetStack.forEach(lt => lt.decreaseLoopEnvLevel()); } } @@ -131,13 +138,18 @@ export class LabelTarget { LabelTarget.name2LabelTarget.delete(labelName); } + static getCurLoopLabelTarget() { + return LabelTarget.curLoopLabelTarget; + } + static getLabelTarget(stmt: ts.BreakOrContinueStatement): LabelTarget { let labelTarget: LabelTarget; if (stmt.label) { let labelName = jshelpers.getTextOfIdentifierOrLiteral(stmt.label); labelTarget = LabelTarget.name2LabelTarget.get(labelName)!; } else { - labelTarget = LabelTarget.getCloseLabelTarget()!; + labelTarget = + ts.isContinueStatement(stmt) ? LabelTarget.getCurLoopLabelTarget() : LabelTarget.getCloseLabelTarget()!; } return labelTarget; } diff --git a/ts2panda/src/statement/switchStatement.ts b/ts2panda/src/statement/switchStatement.ts index 438bf7b7a5..f964b12928 100644 --- a/ts2panda/src/statement/switchStatement.ts +++ b/ts2panda/src/statement/switchStatement.ts @@ -41,14 +41,7 @@ export class SwitchBase { let caseLabel = new Label(); this.caseLabels.push(caseLabel); } - /** - * switchStatements doesn't have continue target - * so we use the uplevel continue label as it's continue target. - */ - let continueLabel = LabelTarget.getCloseContinueTarget(); - let closeLabelTarget = LabelTarget.getCloseLabelTarget(); - let hasLoopEnv = closeLabelTarget ? closeLabelTarget.containLoopEnv() : false; - let labelTarget = new LabelTarget(stmt, switchEndLabel, continueLabel, hasLoopEnv); + let labelTarget = new LabelTarget(stmt, switchEndLabel, undefined); LabelTarget.pushLabelTarget(labelTarget); LabelTarget.updateName2LabelTarget(stmt.parent, labelTarget); } -- Gitee From e8b718c0fe3e1823d7622761aefab10c5c7edc76 Mon Sep 17 00:00:00 2001 From: changjiaxing Date: Wed, 14 Sep 2022 10:59:24 +0800 Subject: [PATCH 08/28] Add ut test for merge abc issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5QY6C?from=project-issue Signed-off-by: changjiaxing Change-Id: I53f814cc89d45202fcd1fd68812832f75075597f --- es2panda/scripts/generate_js_bytecode.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/es2panda/scripts/generate_js_bytecode.py b/es2panda/scripts/generate_js_bytecode.py index f53c7dd2ad..0371d9239b 100755 --- a/es2panda/scripts/generate_js_bytecode.py +++ b/es2panda/scripts/generate_js_bytecode.py @@ -38,6 +38,8 @@ def parse_args(): help='whether is module') parser.add_argument("--commonjs", action='store_true', help='whether is commonjs') + parser.add_argument("--merge-abc", action='store_true', + help='whether is merge abc') arguments = parser.parse_args() return arguments @@ -65,6 +67,9 @@ def gen_abc_info(input_arguments): if input_arguments.commonjs: src_index = cmd.index(input_arguments.src_js) cmd.insert(src_index, '--commonjs') + if input_arguments.merge_abc: + src_index = cmd.index(input_arguments.src_js) + cmd.insert(src_index, '--merge-abc') # insert d.ts option to cmd later run_command(cmd, path) -- Gitee From 3487ef24f361e67489454aad0a1e0550c1c8bf91 Mon Sep 17 00:00:00 2001 From: huangyu Date: Thu, 15 Sep 2022 16:30:12 +0800 Subject: [PATCH 09/28] Fix bug for ts2abc type recording Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I5QD67 Signed-off-by: huangyu Change-Id: I97a7673c27fdcd36cd7876f2943edc30bc731579 --- ...ingLiteralTypesOverloadAssignability04.txt | 4 +- ...ringLiteralTypesWithVariousOperators01.txt | 4 +- ts2panda/src/ts2panda.ts | 3 +- ts2panda/src/typeChecker.ts | 45 ++++++++++++++++--- 4 files changed, 45 insertions(+), 11 deletions(-) diff --git a/testTs/expect/types/stringLiteral/stringLiteralTypesOverloadAssignability04.txt b/testTs/expect/types/stringLiteral/stringLiteralTypesOverloadAssignability04.txt index e23e1f08fc..a8abf45fe2 100644 --- a/testTs/expect/types/stringLiteral/stringLiteralTypesOverloadAssignability04.txt +++ b/testTs/expect/types/stringLiteral/stringLiteralTypesOverloadAssignability04.txt @@ -1,2 +1,2 @@ -{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}]} -{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}]} diff --git a/testTs/expect/types/stringLiteral/stringLiteralTypesWithVariousOperators01.txt b/testTs/expect/types/stringLiteral/stringLiteralTypesWithVariousOperators01.txt index a9b36377ef..89c859a6aa 100644 --- a/testTs/expect/types/stringLiteral/stringLiteralTypesWithVariousOperators01.txt +++ b/testTs/expect/types/stringLiteral/stringLiteralTypesWithVariousOperators01.txt @@ -1,2 +1,2 @@ -{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} -{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}]} diff --git a/ts2panda/src/ts2panda.ts b/ts2panda/src/ts2panda.ts index ce26b5286e..190871169d 100644 --- a/ts2panda/src/ts2panda.ts +++ b/ts2panda/src/ts2panda.ts @@ -171,8 +171,9 @@ export class Ts2Panda { let literalArrays = PandaGen.getLiteralArrayBuffer(); if (CmdOptions.enableTypeLog()) { console.log("-------- LiteralArrayBuffer --------"); + const util = require('util'); for (let e of PandaGen.getLiteralArrayBuffer()) { - console.log(JSON.parse(JSON.stringify(e))); + console.log(util.inspect(JSON.parse(JSON.stringify(e)), { maxArrayLength: null })); } } diff --git a/ts2panda/src/typeChecker.ts b/ts2panda/src/typeChecker.ts index a9ec53df8f..aca8fd8283 100644 --- a/ts2panda/src/typeChecker.ts +++ b/ts2panda/src/typeChecker.ts @@ -195,6 +195,22 @@ export class TypeChecker { } } + public getTypeForLiteralTypeNode(node: ts.Node) { + switch (node.kind) { + case ts.SyntaxKind.NumericLiteral: + return PrimitiveType.NUMBER; + case ts.SyntaxKind.TrueKeyword: + case ts.SyntaxKind.FalseKeyword: + return PrimitiveType.BOOLEAN; + case ts.SyntaxKind.StringLiteral: + return PrimitiveType.STRING; + case ts.SyntaxKind.NullKeyword: + return PrimitiveType.NULL; + default: + return PrimitiveType.ANY; + } + } + public getTypeFromAnotation(typeNode: ts.TypeNode | undefined) { if (!typeNode) { return PrimitiveType.ANY; @@ -206,13 +222,15 @@ export class TypeChecker { case ts.SyntaxKind.SymbolKeyword: case ts.SyntaxKind.UndefinedKeyword: case ts.SyntaxKind.VoidKeyword: - case ts.SyntaxKind.LiteralType: let typeName = typeNode.getText().toUpperCase(); let typeIndex = PrimitiveType.ANY; if (typeName && typeName in PrimitiveType) { typeIndex = PrimitiveType[typeName as keyof typeof PrimitiveType]; } return typeIndex; + case ts.SyntaxKind.LiteralType: + let literalType = (typeNode).literal; + return this.getTypeForLiteralTypeNode(literalType); case ts.SyntaxKind.UnionType: let unionType = new UnionType(typeNode); return unionType.shiftedTypeIndex; @@ -229,6 +247,17 @@ export class TypeChecker { case ts.SyntaxKind.TypeLiteral: let objectType = new ObjectType(typeNode); return objectType.shiftedTypeIndex; + case ts.SyntaxKind.TypeReference: + let typeIdentifier = (typeNode).typeName; + let typeIdentifierName = jshelpers.getTextOfIdentifierOrLiteral(typeIdentifier); + if (BuiltinType[typeIdentifierName]) { + let declNode = this.getDeclNodeForInitializer(typeIdentifier); + if (declNode && ts.isClassLike(declNode)) { + return this.getBuiltinTypeIndex(typeNode, typeIdentifierName); + } else { + return BuiltinType[typeIdentifierName]; + } + } default: return PrimitiveType.ANY; } @@ -262,10 +291,8 @@ export class TypeChecker { return this.getOrCreateInstanceType(builtinContainerTypeIdx); } - getBuiltinTypeIndex(expr: ts.NewExpression) { - let origExprNode = ts.getOriginalNode(expr); - let name = origExprNode.expression.getFullText().replace(/\s/g, ""); - let typeArguments = origExprNode.typeArguments; + getBuiltinTypeIndex(node: ts.NewExpression | ts.TypeReferenceNode, name: string) { + let typeArguments = node.typeArguments; if (typeArguments) { let typeArgIdxs = new Array(); for(let typeArg of typeArguments) { @@ -281,6 +308,12 @@ export class TypeChecker { return this.getOrCreateInstanceType(BuiltinType[name]); } + getBuiltinTypeIndexForExpr(expr: ts.NewExpression) { + let origExprNode = ts.getOriginalNode(expr); + let name = origExprNode.expression.getFullText().replace(/\s/g, ""); + return this.getBuiltinTypeIndex(origExprNode, name); + } + public getOrCreateRecordForDeclNode(initializer: ts.Node | undefined, variableNode?: ts.Node) { if (!initializer) { return PrimitiveType.ANY; @@ -288,7 +321,7 @@ export class TypeChecker { let typeIndex = PrimitiveType.ANY; if (initializer.kind == ts.SyntaxKind.NewExpression && this.isBuiltinType(initializer)) { - typeIndex = this.getBuiltinTypeIndex(initializer); + typeIndex = this.getBuiltinTypeIndexForExpr(initializer); } else { let declNode = this.getDeclNodeForInitializer(initializer); typeIndex = this.getTypeFromDecl(declNode, initializer.kind == ts.SyntaxKind.NewExpression); -- Gitee From 7caacfb4cbee88c88169a9f1c3e41ec556e813fd Mon Sep 17 00:00:00 2001 From: chenqy930 Date: Thu, 15 Sep 2022 16:34:40 +0800 Subject: [PATCH 10/28] Make func_main_0 external in patch mode Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5R1Y5 Signed-off-by: chenqy930 Change-Id: I49848e1c655afa034469704be06f62e41024adf0 --- es2panda/util/hotfix.cpp | 18 ++++++------------ es2panda/util/hotfix.h | 6 ++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/es2panda/util/hotfix.cpp b/es2panda/util/hotfix.cpp index 1241548e80..1994170652 100644 --- a/es2panda/util/hotfix.cpp +++ b/es2panda/util/hotfix.cpp @@ -32,12 +32,6 @@ const std::string EXTERNAL_ATTRIBUTE = "external"; const uint32_t PATCH_ENV_VREG = 0; // reuse first param vreg const panda::panda_file::SourceLang SRC_LANG = panda::panda_file::SourceLang::ECMASCRIPT; -const std::string FUNC_MAIN = "func_main_0"; -// stores newly added function define ins, runtime will execute -const std::string PATCH_FUNC_MAIN_0 = "patch_main_0"; -// stores modified function and class define ins, runtime will scan but not execute -const std::string PATCH_FUNC_MAIN_1 = "patch_main_1"; - void Hotfix::ProcessFunction(const compiler::PandaGen *pg, panda::pandasm::Function *func, LiteralBuffers &literalBuffers) { @@ -219,7 +213,7 @@ bool Hotfix::IsScopeValidToPatchLexical(binder::VariableScope *scope) } auto funcName = scope->AsFunctionVariableScope()->InternalName(); - if (std::string(funcName) != (recordName_ + FUNC_MAIN)) { + if (std::string(funcName) != funcMain0_) { return false; } return true; @@ -234,7 +228,7 @@ void Hotfix::AllocSlotfromPatchEnv(const std::string &variableName) uint32_t Hotfix::GetSlotIdFromSymbolTable(const std::string &variableName) { - auto functionIter = originFunctionInfo_->find(recordName_ + FUNC_MAIN); + auto functionIter = originFunctionInfo_->find(funcMain0_); if (functionIter != originFunctionInfo_->end()) { auto lexenvIter = functionIter->second.lexenv.find(variableName); if (lexenvIter != functionIter->second.lexenv.end()) { @@ -374,8 +368,8 @@ void Hotfix::Finalize(panda::pandasm::Program **prog) return; } - panda::pandasm::Function patchFuncMain0(recordName_ + PATCH_FUNC_MAIN_0, SRC_LANG); - panda::pandasm::Function patchFuncMain1(recordName_ + PATCH_FUNC_MAIN_1, SRC_LANG); + panda::pandasm::Function patchFuncMain0(patchMain0_, SRC_LANG); + panda::pandasm::Function patchFuncMain1(patchMain1_, SRC_LANG); CreateFunctionPatchMain0AndMain1(patchFuncMain0, patchFuncMain1); (*prog)->function_table.emplace(patchFuncMain0.name, std::move(patchFuncMain0)); @@ -387,7 +381,7 @@ bool Hotfix::CompareLexenv(const std::string &funcName, const compiler::PandaGen { auto &lexicalVarNameAndTypes = pg->TopScope()->GetLexicalVarNameAndTypes(); auto &lexenv = bytecodeInfo.lexenv; - if (funcName != (recordName_ + FUNC_MAIN)) { + if (funcName != funcMain0_) { if (lexenv.size() != lexicalVarNameAndTypes.size()) { std::cerr << "Found lexenv size changed, not supported!" << std::endl; patchError_ = true; @@ -458,7 +452,7 @@ void Hotfix::HandleFunction(const compiler::PandaGen *pg, panda::pandasm::Functi } auto funcHash = std::to_string(hashList.back().second); - if (funcHash == bytecodeInfo.funcHash) { + if (funcHash == bytecodeInfo.funcHash || funcName == funcMain0_) { func->metadata->SetAttribute(EXTERNAL_ATTRIBUTE); } else { patchFuncNames_.insert(funcName); diff --git a/es2panda/util/hotfix.h b/es2panda/util/hotfix.h index 17b8d061a7..53bf7a043e 100644 --- a/es2panda/util/hotfix.h +++ b/es2panda/util/hotfix.h @@ -50,6 +50,9 @@ public: classMemberFunctions_(allocator_.Adapter()) { originFunctionInfo_ = symbolTable_->GetOriginFunctionInfo(); originModuleInfo_ = symbolTable_->GetOriginModuleInfo(); + patchMain0_ = recordName_ + "patch_main_0"; + patchMain1_ = recordName_ + "patch_main_1"; + funcMain0_ = recordName_ + "func_main_0"; } void Finalize(panda::pandasm::Program **prog); @@ -91,6 +94,9 @@ private: bool generateSymbolFile_ {false}; bool generatePatch_ {false}; std::string recordName_; + std::string funcMain0_; + std::string patchMain0_; // stores newly added function define ins, runtime will execute + std::string patchMain1_; // stores modified function and class define ins, runtime will scan but not execute util::SymbolTable* symbolTable_ {nullptr}; ArenaAllocator allocator_; -- Gitee From 34580532485aad29f09d90b68fc91ba8ab468e4d Mon Sep 17 00:00:00 2001 From: zhangchen168 Date: Tue, 13 Sep 2022 20:35:58 +0800 Subject: [PATCH 11/28] Fix the constructor overload and declare passing in class 1:Support the constructor overload and declare passing in class 2:Fix declaration and implementation of the constructor 3:Add two test cases and expectations: es2panda/test/parser/ts/test-cyclic-module-import.ts es2panda/test/parser/ts/test-cyclic-module-import-expected.txt es2panda/test/parser/ts/test-type-with-specieal-constructor.ts es2panda/test/parser/ts/test-type-with-specieal-constructor-expected.txt Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I5R25C Test: test262,parser tests Change-Id: I78c25befba939a2141b6ee45b2df4ce57bbb417f Signed-off-by: zhangchen168 --- es2panda/parser/parserImpl.cpp | 17 +- .../ts/test-class-constructor1-expected.txt | 2 +- .../ts/test-class-constructor2-expected.txt | 2 +- .../ts/test-class-constructor4-expected.txt | 126 +-- .../ts/test-cyclic-module-import-expected.txt | 715 ++++++++++++++++++ .../parser/ts/test-cyclic-module-import.ts | 36 + ...ype-with-specieal-constructor-expected.txt | 416 ++++++++++ .../ts/test-type-with-specieal-constructor.ts | 32 + 8 files changed, 1217 insertions(+), 129 deletions(-) create mode 100644 es2panda/test/parser/ts/test-cyclic-module-import-expected.txt create mode 100644 es2panda/test/parser/ts/test-cyclic-module-import.ts create mode 100644 es2panda/test/parser/ts/test-type-with-specieal-constructor-expected.txt create mode 100644 es2panda/test/parser/ts/test-type-with-specieal-constructor.ts diff --git a/es2panda/parser/parserImpl.cpp b/es2panda/parser/parserImpl.cpp index 5d45e3e3ca..664faf665e 100644 --- a/es2panda/parser/parserImpl.cpp +++ b/es2panda/parser/parserImpl.cpp @@ -2657,6 +2657,7 @@ ir::Identifier *ParserImpl::SetIdentNodeInClassDefinition() ir::ClassDefinition *ParserImpl::ParseClassDefinition(bool isDeclaration, bool idRequired, bool isDeclare, bool isAbstract) { + isDeclare = isDeclare | (context_.Status() & ParserStatus::IN_AMBIENT_CONTEXT); lexer::SourcePosition startLoc = lexer_->GetToken().Start(); lexer_->NextToken(); @@ -2758,6 +2759,8 @@ ir::ClassDefinition *ParserImpl::ParseClassDefinition(bool isDeclaration, bool i ir::MethodDefinition *ctor = nullptr; ArenaVector properties(Allocator()->Adapter()); ArenaVector indexSignatures(Allocator()->Adapter()); + bool hasConstructorFuncBody = false; + bool isCtorContinuousDefined = true; while (lexer_->GetToken().Type() != lexer::TokenType::PUNCTUATOR_RIGHT_BRACE) { if (lexer_->GetToken().Type() == lexer::TokenType::PUNCTUATOR_SEMI_COLON) { @@ -2772,13 +2775,18 @@ ir::ClassDefinition *ParserImpl::ParseClassDefinition(bool isDeclaration, bool i } if (IsConstructor(property)) { - if (!isDeclare && ctor) { + if (!isDeclare && !isCtorContinuousDefined) { + ThrowSyntaxError("Constructor implementation is missing.", property->Start()); + } + + if (hasConstructorFuncBody) { ThrowSyntaxError("Multiple constructor implementations are not allowed.", property->Start()); } ctor = property->AsMethodDefinition(); + hasConstructorFuncBody = ctor->Value()->Function()->Body() != nullptr; continue; } - + isCtorContinuousDefined = ctor == nullptr; properties.push_back(property); } @@ -2788,9 +2796,14 @@ ir::ClassDefinition *ParserImpl::ParseClassDefinition(bool isDeclaration, bool i if (ctor == nullptr) { ctor = CreateImplicitConstructor(hasSuperClass, isDeclare); ctor->SetRange({startLoc, classBodyEndLoc}); + hasConstructorFuncBody = !isDeclare; } lexer_->NextToken(); + if (!isDeclare && !hasConstructorFuncBody) { + ThrowSyntaxError("Constructor implementation is missing.", ctor->Start()); + } + auto *classDefinition = AllocNode( classCtx.GetScope(), identNode, typeParamDecl, superTypeParams, std::move(implements), ctor, superClass, std::move(properties), std::move(indexSignatures), isDeclare, isAbstract); diff --git a/es2panda/test/parser/ts/test-class-constructor1-expected.txt b/es2panda/test/parser/ts/test-class-constructor1-expected.txt index b8dc6e627c..0c9cd3e40c 100644 --- a/es2panda/test/parser/ts/test-class-constructor1-expected.txt +++ b/es2panda/test/parser/ts/test-class-constructor1-expected.txt @@ -1 +1 @@ -SyntaxError: Multiple constructor implementations are not allowed. [test-class-constructor1.ts:20:5] +SyntaxError: Constructor implementation is missing. [test-class-constructor1.ts:20:5] diff --git a/es2panda/test/parser/ts/test-class-constructor2-expected.txt b/es2panda/test/parser/ts/test-class-constructor2-expected.txt index 3c80b2dbf2..e2a756d71f 100644 --- a/es2panda/test/parser/ts/test-class-constructor2-expected.txt +++ b/es2panda/test/parser/ts/test-class-constructor2-expected.txt @@ -1 +1 @@ -SyntaxError: Multiple constructor implementations are not allowed. [test-class-constructor2.ts:19:5] +SyntaxError: Constructor implementation is missing. [test-class-constructor2.ts:21:5] diff --git a/es2panda/test/parser/ts/test-class-constructor4-expected.txt b/es2panda/test/parser/ts/test-class-constructor4-expected.txt index 1d1294954f..e1214afcca 100644 --- a/es2panda/test/parser/ts/test-class-constructor4-expected.txt +++ b/es2panda/test/parser/ts/test-class-constructor4-expected.txt @@ -1,125 +1 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } -} +SyntaxError: Constructor implementation is missing. [test-class-constructor4.ts:18:5] diff --git a/es2panda/test/parser/ts/test-cyclic-module-import-expected.txt b/es2panda/test/parser/ts/test-cyclic-module-import-expected.txt new file mode 100644 index 0000000000..5979c2c1cb --- /dev/null +++ b/es2panda/test/parser/ts/test-cyclic-module-import-expected.txt @@ -0,0 +1,715 @@ +{ + "type": "Program", + "statements": [ + { + "type": "TSModuleDeclaration", + "id": { + "type": "StringLiteral", + "value": "ModuleSub", + "loc": { + "start": { + "line": 18, + "column": 16 + }, + "end": { + "line": 18, + "column": 27 + } + } + }, + "body": { + "type": "TSModuleBlock", + "body": [ + { + "type": "TSImportEqualsDeclaration", + "id": { + "type": "Identifier", + "name": "TargetModule", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 12 + }, + "end": { + "line": 19, + "column": 24 + } + } + }, + "moduleReference": { + "type": "TSExternalModuleReference", + "expression": { + "type": "StringLiteral", + "value": "TargetModule", + "loc": { + "start": { + "line": 19, + "column": 35 + }, + "end": { + "line": 19, + "column": 49 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 27 + }, + "end": { + "line": 19, + "column": 50 + } + } + }, + "isExport": false, + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 51 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ModuleSub", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 11 + }, + "end": { + "line": 20, + "column": 20 + } + } + }, + "superClass": null, + "implements": [], + "constructor": { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 24, + "column": 9 + }, + "end": { + "line": 24, + "column": 20 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": null, + "generator": false, + "async": false, + "expression": false, + "params": [], + "loc": { + "start": { + "line": 24, + "column": 20 + }, + "end": { + "line": 24, + "column": 23 + } + } + }, + "loc": { + "start": { + "line": 24, + "column": 20 + }, + "end": { + "line": 24, + "column": 23 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 24, + "column": 9 + }, + "end": { + "line": 24, + "column": 23 + } + } + }, + "body": [ + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "StaticVar", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 23 + }, + "end": { + "line": 21, + "column": 32 + } + } + }, + "accessibility": "public", + "static": true, + "readonly": false, + "declare": false, + "optional": false, + "computed": false, + "typeAnnotation": { + "type": "TSNumberKeyword", + "loc": { + "start": { + "line": 21, + "column": 34 + }, + "end": { + "line": 21, + "column": 40 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 9 + }, + "end": { + "line": 21, + "column": 32 + } + } + }, + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "InsVar", + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 16 + }, + "end": { + "line": 22, + "column": 22 + } + } + }, + "accessibility": "public", + "static": false, + "readonly": false, + "declare": false, + "optional": false, + "computed": false, + "typeAnnotation": { + "type": "TSNumberKeyword", + "loc": { + "start": { + "line": 22, + "column": 24 + }, + "end": { + "line": 22, + "column": 30 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 9 + }, + "end": { + "line": 22, + "column": 22 + } + } + }, + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 16 + }, + "end": { + "line": 23, + "column": 20 + } + } + }, + "accessibility": "public", + "static": false, + "readonly": false, + "declare": false, + "optional": false, + "computed": false, + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "TargetModule", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 22 + }, + "end": { + "line": 23, + "column": 34 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 22 + }, + "end": { + "line": 23, + "column": 34 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 9 + }, + "end": { + "line": 23, + "column": 20 + } + } + } + ], + "indexSignatures": [], + "loc": { + "start": { + "line": 20, + "column": 21 + }, + "end": { + "line": 25, + "column": 6 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 25, + "column": 6 + } + } + }, + { + "type": "TSExportAssignment", + "declaration": { + "type": "Identifier", + "name": "ModuleSub", + "decorators": [], + "loc": { + "start": { + "line": 26, + "column": 14 + }, + "end": { + "line": 26, + "column": 23 + } + } + }, + "loc": { + "start": { + "line": 26, + "column": 5 + }, + "end": { + "line": 26, + "column": 24 + } + } + } + ], + "loc": { + "start": { + "line": 18, + "column": 28 + }, + "end": { + "line": 27, + "column": 2 + } + } + }, + "declare": true, + "global": false, + "loc": { + "start": { + "line": 18, + "column": 9 + }, + "end": { + "line": 29, + "column": 8 + } + } + }, + { + "type": "TSModuleDeclaration", + "id": { + "type": "StringLiteral", + "value": "TargetModule", + "loc": { + "start": { + "line": 29, + "column": 16 + }, + "end": { + "line": 29, + "column": 30 + } + } + }, + "body": { + "type": "TSModuleBlock", + "body": [ + { + "type": "TSImportEqualsDeclaration", + "id": { + "type": "Identifier", + "name": "ModuleSub", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 12 + }, + "end": { + "line": 30, + "column": 21 + } + } + }, + "moduleReference": { + "type": "TSExternalModuleReference", + "expression": { + "type": "StringLiteral", + "value": "ModuleSub", + "loc": { + "start": { + "line": 30, + "column": 32 + }, + "end": { + "line": 30, + "column": 43 + } + } + }, + "loc": { + "start": { + "line": 30, + "column": 24 + }, + "end": { + "line": 30, + "column": 44 + } + } + }, + "isExport": false, + "loc": { + "start": { + "line": 30, + "column": 5 + }, + "end": { + "line": 30, + "column": 45 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "TargetModule", + "decorators": [], + "loc": { + "start": { + "line": 31, + "column": 11 + }, + "end": { + "line": 31, + "column": 23 + } + } + }, + "superClass": null, + "implements": [], + "constructor": { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 33, + "column": 9 + }, + "end": { + "line": 33, + "column": 20 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": null, + "generator": false, + "async": false, + "expression": false, + "params": [], + "loc": { + "start": { + "line": 33, + "column": 20 + }, + "end": { + "line": 33, + "column": 23 + } + } + }, + "loc": { + "start": { + "line": 33, + "column": 20 + }, + "end": { + "line": 33, + "column": 23 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 33, + "column": 9 + }, + "end": { + "line": 33, + "column": 23 + } + } + }, + "body": [ + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "moduleSub", + "decorators": [], + "loc": { + "start": { + "line": 32, + "column": 16 + }, + "end": { + "line": 32, + "column": 25 + } + } + }, + "accessibility": "public", + "static": false, + "readonly": false, + "declare": false, + "optional": false, + "computed": false, + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "ModuleSub", + "decorators": [], + "loc": { + "start": { + "line": 32, + "column": 27 + }, + "end": { + "line": 32, + "column": 36 + } + } + }, + "loc": { + "start": { + "line": 32, + "column": 27 + }, + "end": { + "line": 32, + "column": 36 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 32, + "column": 9 + }, + "end": { + "line": 32, + "column": 25 + } + } + } + ], + "indexSignatures": [], + "loc": { + "start": { + "line": 31, + "column": 24 + }, + "end": { + "line": 34, + "column": 6 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 31, + "column": 5 + }, + "end": { + "line": 34, + "column": 6 + } + } + }, + { + "type": "TSExportAssignment", + "declaration": { + "type": "Identifier", + "name": "TargetModule", + "decorators": [], + "loc": { + "start": { + "line": 35, + "column": 14 + }, + "end": { + "line": 35, + "column": 26 + } + } + }, + "loc": { + "start": { + "line": 35, + "column": 5 + }, + "end": { + "line": 35, + "column": 27 + } + } + } + ], + "loc": { + "start": { + "line": 29, + "column": 31 + }, + "end": { + "line": 36, + "column": 2 + } + } + }, + "declare": true, + "global": false, + "loc": { + "start": { + "line": 29, + "column": 9 + }, + "end": { + "line": 37, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 37, + "column": 1 + } + } +} diff --git a/es2panda/test/parser/ts/test-cyclic-module-import.ts b/es2panda/test/parser/ts/test-cyclic-module-import.ts new file mode 100644 index 0000000000..6068088306 --- /dev/null +++ b/es2panda/test/parser/ts/test-cyclic-module-import.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +// @declaration: true +declare module "ModuleSub" { + import TargetModule = require('TargetModule'); + class ModuleSub { + public static StaticVar: number; + public InsVar: number; + public main: TargetModule; + constructor(); + } + export = ModuleSub; +} + +declare module "TargetModule" { + import ModuleSub = require('ModuleSub'); + class TargetModule { + public moduleSub: ModuleSub; + constructor(); + } + export = TargetModule; +} diff --git a/es2panda/test/parser/ts/test-type-with-specieal-constructor-expected.txt b/es2panda/test/parser/ts/test-type-with-specieal-constructor-expected.txt new file mode 100644 index 0000000000..a7d4bcf372 --- /dev/null +++ b/es2panda/test/parser/ts/test-type-with-specieal-constructor-expected.txt @@ -0,0 +1,416 @@ +{ + "type": "Program", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ClassExample", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 19 + } + } + }, + "superClass": null, + "implements": [], + "constructor": { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 5 + }, + "end": { + "line": 21, + "column": 16 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": null, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "name": "a", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 17 + }, + "end": { + "line": 21, + "column": 18 + } + } + } + ], + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ReturnStatement", + "argument": { + "type": "Identifier", + "name": "a", + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 16 + }, + "end": { + "line": 22, + "column": 17 + } + } + }, + "loc": { + "start": { + "line": 22, + "column": 9 + }, + "end": { + "line": 22, + "column": 18 + } + } + } + ], + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 23, + "column": 6 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 16 + }, + "end": { + "line": 23, + "column": 6 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 16 + }, + "end": { + "line": 23, + "column": 6 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 5 + }, + "end": { + "line": 23, + "column": 6 + } + } + }, + "body": [], + "indexSignatures": [], + "loc": { + "start": { + "line": 17, + "column": 20 + }, + "end": { + "line": 24, + "column": 2 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 24, + "column": 2 + } + } + }, + { + "type": "TSModuleDeclaration", + "id": { + "type": "Identifier", + "name": "ns", + "decorators": [], + "loc": { + "start": { + "line": 26, + "column": 19 + }, + "end": { + "line": 26, + "column": 21 + } + } + }, + "body": { + "type": "TSModuleBlock", + "body": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "A", + "decorators": [], + "loc": { + "start": { + "line": 27, + "column": 11 + }, + "end": { + "line": 27, + "column": 12 + } + } + }, + "superClass": null, + "implements": [], + "constructor": { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 9 + }, + "end": { + "line": 30, + "column": 20 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": null, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "name": "x", + "typeAnnotation": { + "type": "TSNumberKeyword", + "loc": { + "start": { + "line": 30, + "column": 23 + }, + "end": { + "line": 30, + "column": 29 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 21 + }, + "end": { + "line": 30, + "column": 22 + } + } + } + ], + "loc": { + "start": { + "line": 30, + "column": 20 + }, + "end": { + "line": 30, + "column": 31 + } + } + }, + "loc": { + "start": { + "line": 30, + "column": 20 + }, + "end": { + "line": 30, + "column": 31 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 9 + }, + "end": { + "line": 30, + "column": 31 + } + } + }, + "body": [ + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "a", + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 9 + }, + "end": { + "line": 29, + "column": 10 + } + } + }, + "static": false, + "readonly": false, + "declare": false, + "optional": false, + "computed": false, + "typeAnnotation": { + "type": "TSStringKeyword", + "loc": { + "start": { + "line": 29, + "column": 11 + }, + "end": { + "line": 29, + "column": 17 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 9 + }, + "end": { + "line": 29, + "column": 10 + } + } + } + ], + "indexSignatures": [], + "loc": { + "start": { + "line": 27, + "column": 13 + }, + "end": { + "line": 31, + "column": 6 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 27, + "column": 5 + }, + "end": { + "line": 31, + "column": 6 + } + } + } + ], + "loc": { + "start": { + "line": 26, + "column": 22 + }, + "end": { + "line": 32, + "column": 2 + } + } + }, + "declare": true, + "global": false, + "loc": { + "start": { + "line": 26, + "column": 9 + }, + "end": { + "line": 32, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 32, + "column": 2 + } + } +} diff --git a/es2panda/test/parser/ts/test-type-with-specieal-constructor.ts b/es2panda/test/parser/ts/test-type-with-specieal-constructor.ts new file mode 100644 index 0000000000..2000dd2a79 --- /dev/null +++ b/es2panda/test/parser/ts/test-type-with-specieal-constructor.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +class ClassExample { + constructor(a: 'hello'); + constructor(a: 'bye'); + constructor(a: string); + constructor(a) { + return a; + } +} + +declare namespace ns { + class A { + constructor(); + a:string; + constructor(x:number); + } +} \ No newline at end of file -- Gitee From 62b10ab631760146eb6a6eb79df592ba70c71a97 Mon Sep 17 00:00:00 2001 From: wangyantian Date: Fri, 16 Sep 2022 15:40:47 +0800 Subject: [PATCH 12/28] Fix bug of parsing ts generic arrow function Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I5RGA8 Test: parser test/test262 Signed-off-by: wangyantian --- es2panda/parser/expressionParser.cpp | 2 +- ...-function-with-type-assertion-expected.txt | 1056 +++++++++++++++++ .../ts/test-function-with-type-assertion.ts | 20 + 3 files changed, 1077 insertions(+), 1 deletion(-) create mode 100644 es2panda/test/parser/ts/test-function-with-type-assertion-expected.txt create mode 100644 es2panda/test/parser/ts/test-function-with-type-assertion.ts diff --git a/es2panda/parser/expressionParser.cpp b/es2panda/parser/expressionParser.cpp index e0d85967de..56bbe33c8d 100644 --- a/es2panda/parser/expressionParser.cpp +++ b/es2panda/parser/expressionParser.cpp @@ -496,7 +496,7 @@ ir::ArrowFunctionExpression *ParserImpl::ParseTsGenericArrowFunction() ir::TSTypeParameterDeclaration *typeParamDecl = ParseTsTypeParameterDeclaration(false); - if (lexer_->GetToken().Type() != lexer::TokenType::PUNCTUATOR_LEFT_PARENTHESIS) { + if (typeParamDecl == nullptr || lexer_->GetToken().Type() != lexer::TokenType::PUNCTUATOR_LEFT_PARENTHESIS) { return nullptr; } diff --git a/es2panda/test/parser/ts/test-function-with-type-assertion-expected.txt b/es2panda/test/parser/ts/test-function-with-type-assertion-expected.txt new file mode 100644 index 0000000000..e467c54f02 --- /dev/null +++ b/es2panda/test/parser/ts/test-function-with-type-assertion-expected.txt @@ -0,0 +1,1056 @@ + { + "type": "Program", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "Base", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 11 + } + } + }, + "superClass": null, + "implements": [], + "constructor": { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": null, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 16, + "column": 26 + } + } + }, + "body": [ + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "p", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 22 + }, + "end": { + "line": 16, + "column": 23 + } + } + }, + "accessibility": "private", + "static": false, + "readonly": false, + "declare": false, + "optional": false, + "computed": false, + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 16, + "column": 23 + } + } + } + ], + "indexSignatures": [], + "loc": { + "start": { + "line": 16, + "column": 12 + }, + "end": { + "line": 16, + "column": 26 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 16, + "column": 26 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "Derived1", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 7 + }, + "end": { + "line": 17, + "column": 15 + } + } + }, + "superClass": { + "type": "Identifier", + "name": "Base", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 24 + }, + "end": { + "line": 17, + "column": 28 + } + } + }, + "implements": [], + "constructor": { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": null, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "RestElement", + "argument": { + "type": "Identifier", + "name": "args", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "Super", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "arguments": [ + { + "type": "SpreadElement", + "argument": { + "type": "Identifier", + "name": "args", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "optional": false, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 17, + "column": 43 + } + } + }, + "body": [ + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "m", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 39 + }, + "end": { + "line": 17, + "column": 40 + } + } + }, + "accessibility": "private", + "static": false, + "readonly": false, + "declare": false, + "optional": false, + "computed": false, + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 31 + }, + "end": { + "line": 17, + "column": 40 + } + } + } + ], + "indexSignatures": [], + "loc": { + "start": { + "line": 17, + "column": 29 + }, + "end": { + "line": 17, + "column": 43 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 17, + "column": 43 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "d1", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 7 + } + } + }, + "init": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "Base", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 14 + }, + "end": { + "line": 18, + "column": 18 + } + } + }, + "arguments": [], + "loc": { + "start": { + "line": 18, + "column": 10 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "d2", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "init": { + "type": "NewExpression", + "callee": { + "type": "Identifier", + "name": "Derived1", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 39 + } + } + }, + "arguments": [], + "loc": { + "start": { + "line": 18, + "column": 27 + }, + "end": { + "line": 18, + "column": 41 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 41 + } + } + } + ], + "kind": "var", + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 18, + "column": 42 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "func1", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 10 + } + } + }, + "init": { + "type": "TSTypeAssertion", + "typeAnnotation": { + "type": "TSFunctionType", + "params": [], + "returnType": { + "type": "TSArrayType", + "elementType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Base", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 20 + }, + "end": { + "line": 19, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 20 + }, + "end": { + "line": 19, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 20 + }, + "end": { + "line": 19, + "column": 26 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 14 + }, + "end": { + "line": 19, + "column": 26 + } + } + }, + "expression": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": null, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ArrayExpression", + "elements": [ + { + "type": "Identifier", + "name": "d1", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 48 + }, + "end": { + "line": 19, + "column": 50 + } + } + }, + { + "type": "Identifier", + "name": "d2", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 52 + }, + "end": { + "line": 19, + "column": 54 + } + } + } + ], + "loc": { + "start": { + "line": 19, + "column": 47 + }, + "end": { + "line": 19, + "column": 55 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 40 + }, + "end": { + "line": 19, + "column": 55 + } + } + } + ], + "loc": { + "start": { + "line": 19, + "column": 38 + }, + "end": { + "line": 19, + "column": 57 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 27 + }, + "end": { + "line": 19, + "column": 57 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 27 + }, + "end": { + "line": 19, + "column": 57 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 13 + }, + "end": { + "line": 19, + "column": 58 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 58 + } + } + } + ], + "kind": "var", + "loc": { + "start": { + "line": 19, + "column": 1 + }, + "end": { + "line": 19, + "column": 58 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "func2", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 10 + } + } + }, + "init": { + "type": "TSTypeAssertion", + "typeAnnotation": { + "type": "TSFunctionType", + "params": [ + { + "type": "Identifier", + "name": "arg0", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 21 + }, + "end": { + "line": 20, + "column": 27 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 21 + }, + "end": { + "line": 20, + "column": 27 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 15 + }, + "end": { + "line": 20, + "column": 19 + } + } + } + ], + "returnType": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 32 + }, + "end": { + "line": 20, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 32 + }, + "end": { + "line": 20, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 14 + }, + "end": { + "line": 20, + "column": 38 + } + } + }, + "expression": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": null, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "Identifier", + "name": "a", + "typeAnnotation": { + "type": "TSTypeReference", + "typeName": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 51 + }, + "end": { + "line": 20, + "column": 57 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 51 + }, + "end": { + "line": 20, + "column": 57 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 48 + }, + "end": { + "line": 20, + "column": 49 + } + } + } + ], + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ReturnStatement", + "argument": { + "type": "Identifier", + "name": "a", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 68 + }, + "end": { + "line": 20, + "column": 69 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 61 + }, + "end": { + "line": 20, + "column": 69 + } + } + } + ], + "loc": { + "start": { + "line": 20, + "column": 59 + }, + "end": { + "line": 20, + "column": 71 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 39 + }, + "end": { + "line": 20, + "column": 71 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 39 + }, + "end": { + "line": 20, + "column": 71 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 13 + }, + "end": { + "line": 20, + "column": 72 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 72 + } + } + } + ], + "kind": "var", + "loc": { + "start": { + "line": 20, + "column": 1 + }, + "end": { + "line": 20, + "column": 72 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 20, + "column": 72 + } + } +} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-function-with-type-assertion.ts b/es2panda/test/parser/ts/test-function-with-type-assertion.ts new file mode 100644 index 0000000000..8f4a2f8056 --- /dev/null +++ b/es2panda/test/parser/ts/test-function-with-type-assertion.ts @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class Base { private p; } +class Derived1 extends Base { private m; } +var d1 = new Base(), d2 = new Derived1(); +var func1 = <() => Base[]>function() { return [d1, d2] }; +var func2 = <(arg0: Number) => Number>function(a: Number) { return a }; \ No newline at end of file -- Gitee From aca35e70fbb23188f82feaa0c13c7e05ff6854f5 Mon Sep 17 00:00:00 2001 From: ctw-ian Date: Mon, 19 Sep 2022 11:21:38 +0800 Subject: [PATCH 13/28] Fix creating lexical env of for-statement on ts2abc Issue:I5RRAH Signed-off-by: ctw-ian Change-Id: I4186581f1738ac560330a5f1365f7287058f294f --- ts2panda/src/statement/loopStatement.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ts2panda/src/statement/loopStatement.ts b/ts2panda/src/statement/loopStatement.ts index 4af9a4a576..476a5c437a 100644 --- a/ts2panda/src/statement/loopStatement.ts +++ b/ts2panda/src/statement/loopStatement.ts @@ -199,7 +199,6 @@ export function compileForStatement(stmt: ts.ForStatement, compiler: Compiler) { compiler.popEnv(); pandaGen.freeTemps(...tmpVregs); } else { // compile for in fast mode - // createLoopEnv if needed if (needCreateLoopEnv) { pandaGen.createLexEnv(stmt, loopEnv, loopScope); compiler.pushEnv(loopEnv); @@ -214,9 +213,20 @@ export function compileForStatement(stmt: ts.ForStatement, compiler: Compiler) { } } + if (needCreateLoopEnv) { + pandaGen.popLexicalEnv(stmt); + compiler.popEnv(); + } + // loopCondition pandaGen.label(stmt, loopStartLabel); + // createLoopEnv if needed + if (needCreateLoopEnv) { + pandaGen.createLexEnv(stmt, loopEnv, loopScope); + compiler.pushEnv(loopEnv); + } + if (stmt.condition) { compiler.compileCondition(stmt.condition, loopEndLabel); } -- Gitee From 4efb8745f571d945fb8dc17673a0a27027aacc06 Mon Sep 17 00:00:00 2001 From: hufeng Date: Tue, 20 Sep 2022 20:30:55 +0800 Subject: [PATCH 14/28] Fix lexical parameter with initialization Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I5S5FX?from=project-issue Test: 262, compiler Signed-off-by: hufeng Change-Id: If3a8308597978043ea779000baa56859f871e1d6 --- es2panda/compiler/core/function.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es2panda/compiler/core/function.cpp b/es2panda/compiler/core/function.cpp index 3f4a050ea0..939d1740ac 100644 --- a/es2panda/compiler/core/function.cpp +++ b/es2panda/compiler/core/function.cpp @@ -75,7 +75,7 @@ static void CompileFunctionParameterDeclaration(PandaGen *pg, const ir::ScriptFu if (param->IsAssignmentPattern()) { RegScope rs(pg); - pg->LoadAccumulator(func, paramReg); + ref.GetValue(); auto *nonDefaultLabel = pg->AllocLabel(); if (ref.Kind() == ReferenceKind::DESTRUCTURING) { -- Gitee From 00d7bea6bc33680fe8ffc882b59f4d8df2f19717 Mon Sep 17 00:00:00 2001 From: wangyantian Date: Wed, 21 Sep 2022 10:42:18 +0800 Subject: [PATCH 15/28] Remove one extra space in testcase expected result Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I5S7TJ Test: es2panda regression test Signed-off-by: wangyantian --- .../parser/ts/test-function-with-type-assertion-expected.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/es2panda/test/parser/ts/test-function-with-type-assertion-expected.txt b/es2panda/test/parser/ts/test-function-with-type-assertion-expected.txt index e467c54f02..afa2bb556a 100644 --- a/es2panda/test/parser/ts/test-function-with-type-assertion-expected.txt +++ b/es2panda/test/parser/ts/test-function-with-type-assertion-expected.txt @@ -1,4 +1,4 @@ - { +{ "type": "Program", "statements": [ { @@ -1053,4 +1053,4 @@ "column": 72 } } -} \ No newline at end of file +} -- Gitee From e3f16149e7a5d83073ee92cae025a5b4d0c124bf Mon Sep 17 00:00:00 2001 From: huangyu Date: Wed, 21 Sep 2022 10:49:13 +0800 Subject: [PATCH 16/28] Add ts2abc type extraction testcase Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I5S863 Test: ts2abc type system test Signed-off-by: huangyu Change-Id: I34ad122eabd8638727f1ed782ea21d4a41abe80f --- .../expect/types/any/assignEveryTypeToAny.txt | 5 + testTs/expect/types/conditional/variance.txt | 6 + .../contextuallyTypedBindingInitializer.txt | 13 ++ ...yTypedObjectLiteralMethodDeclaration01.txt | 8 + .../expect/types/import/importTypeAmbient.txt | 4 + .../intersection/intersectionThisTypes.txt | 7 + .../operatorsAndIntersectionTypes.txt | 4 + .../types/keyof/keyofAndIndexedAccess.txt | 121 ++++++++++++ .../types/literal/booleanLiteralTypes1.txt | 14 ++ .../types/literal/booleanLiteralTypes2.txt | 14 ++ .../types/literal/enumLiteralTypes1.txt | 14 ++ .../types/literal/enumLiteralTypes2.txt | 14 ++ testTs/expect/types/literal/literalTypes1.txt | 9 + testTs/expect/types/literal/literalTypes2.txt | 29 +++ testTs/expect/types/literal/literalTypes3.txt | 11 ++ .../types/literal/numericLiteralTypes1.txt | 17 ++ .../types/literal/numericLiteralTypes2.txt | 17 ++ .../types/literal/stringEnumLiteralTypes1.txt | 13 ++ .../types/literal/stringEnumLiteralTypes2.txt | 13 ++ .../expect/types/localTypes/localTypes2.txt | 14 ++ .../expect/types/localTypes/localTypes3.txt | 14 ++ .../mapped/isomorphicMappedTypeInference.txt | 19 ++ .../types/mapped/mappedTypeModifiers.txt | 5 + testTs/expect/types/mapped/mappedTypes2.txt | 12 ++ testTs/expect/types/mapped/mappedTypes3.txt | 7 + .../types/mapped/mappedTypesAndObjects.txt | 7 + .../types/mapped/mappedTypesArraysTuples.txt | 6 + .../members/classWithProtectedProperty.txt | 7 + .../types/members/classWithPublicProperty.txt | 4 + ...thCallSignatureAppearsToBeFunctionType.txt | 2 + ...thCallSignatureHidingMembersOfFunction.txt | 5 + ...structSignatureHidingMembersOfFunction.txt | 5 + .../members/typesWithOptionalProperty.txt | 3 + .../typesWithSpecializedCallSignatures.txt | 17 ++ ...ypesWithSpecializedConstructSignatures.txt | 14 ++ .../namedTypes/classWithOptionalParameter.txt | 6 + ...InstantiationEquivalentToObjectLiteral.txt | 2 + .../types/namedTypes/optionalMethods.txt | 16 ++ testTs/expect/types/never/neverType.txt | 21 ++ .../callSignatureWithoutAnnotationsOrBody.txt | 4 + ...llSignaturesThatDifferOnlyByReturnType.txt | 2 + .../identicalCallSignatures.txt | 1 + .../parametersWithNoAnnotationAreAny.txt | 5 + ...tureIsSubtypeOfNonSpecializedSignature.txt | 21 ++ ...LiteralTypesInImplementationSignatures.txt | 5 + .../typeParameterAsTypeArgument.txt | 3 + ...ParameterUsedAsTypeParameterConstraint.txt | 2 + ...arameterUsedAsTypeParameterConstraint2.txt | 10 + ...structSignaturesWithIdenticalOverloads.txt | 14 ++ .../constructSignaturesWithOverloads.txt | 14 ++ ...ithOverloadsThatDifferOnlyByReturnType.txt | 8 + .../indexSignatures/stringIndexingResults.txt | 5 + .../methodSignatures/functionLiterals.txt | 8 + .../methodSignaturesWithOverloads2.txt | 4 + .../objectTypeLiteralSyntax.txt | 2 + .../propertyNameWithoutTypeAnnotation.txt | 3 + .../propertyNamesOfReservedWords.txt | 4 + .../undefined/invalidUndefinedValues.txt | 4 + testTs/expect/types/rest/objectRest2.txt | 1 + .../types/rest/objectRestAssignment.txt | 8 + testTs/expect/types/rest/objectRestForOf.txt | 3 + .../expect/types/rest/objectRestParameter.txt | 9 + .../typeLiterals/arrayLiteral.txt | 3 + .../typeLiterals/functionLiteral.txt | 4 + .../functionLiteralForOverloads.txt | 4 + .../functionLiteralForOverloads2.txt | 13 ++ .../typeLiterals/parenthesizedTypes.txt | 13 ++ .../typeQueries/typeofClass2.txt | 13 ++ .../typeofModuleWithoutExports.txt | 1 + .../objectSpreadRepeatedNullCheckPerf.txt | 2 + .../types/spread/spreadOverwritesProperty.txt | 5 + testTs/expect/types/spread/spreadUnion.txt | 10 + ...eralTypesAndParenthesizedExpressions01.txt | 1 + .../stringLiteralTypesAndTuples01.txt | 1 + .../stringLiteralTypesAsTags01.txt | 3 + .../stringLiteralTypesAsTags02.txt | 3 + .../stringLiteralTypesAsTags03.txt | 3 + .../stringLiteralTypesOverloads01.txt | 2 + .../stringLiteralTypesOverloads02.txt | 2 + .../stringLiteralTypesOverloads03.txt | 4 + .../types/thisType/contextualThisType.txt | 2 + .../types/thisType/fluentInterfaces.txt | 6 + .../types/thisType/thisTypeAndConstraints.txt | 9 + .../types/thisType/thisTypeInClasses.txt | 17 ++ .../types/thisType/thisTypeInFunctions3.txt | 5 + .../thisType/thisTypeInObjectLiterals.txt | 4 + .../expect/types/tuple/tupleElementTypes2.txt | 1 + .../expect/types/tuple/tupleElementTypes4.txt | 1 + .../tuple/typeInferenceWithTupleType.txt | 3 + .../circularTypeAliasForUnionWithClass.txt | 6 + .../types/typeAliases/genericTypeAliases.txt | 3 + .../expect/types/typeAliases/typeAliases.txt | 7 + ...llGenericFunctionWithZeroTypeArguments.txt | 12 ++ .../constraintSatisfactionWithAny.txt | 12 ++ .../constraintSatisfactionWithEmptyObject.txt | 10 + .../functionConstraintSatisfaction.txt | 15 ++ .../functionConstraintSatisfaction3.txt | 13 ++ ...tiateGenericClassWithZeroTypeArguments.txt | 4 + ...typeParameterAsTypeParameterConstraint.txt | 4 + ...rAsTypeParameterConstraintTransitively.txt | 5 + ...AsTypeParameterConstraintTransitively2.txt | 5 + .../wrappedAndRecursiveConstraints.txt | 5 + .../wrappedAndRecursiveConstraints2.txt | 3 + .../wrappedAndRecursiveConstraints3.txt | 5 + ...yAccessOnTypeParameterWithConstraints3.txt | 12 ++ .../typeParametersAvailableInNestedScope.txt | 4 + .../anyAssignableToEveryType.txt | 7 + .../assignmentCompatWithObjectMembers.txt | 16 ++ .../assignmentCompatWithObjectMembers3.txt | 8 + ...entCompatWithObjectMembersNumericNames.txt | 8 + .../everyTypeAssignableToAny.txt | 7 + .../nullAssignableToEveryType.txt | 7 + .../undefinedAssignableToEveryType.txt | 7 + ...rrayLiteralWithMultipleBestCommonTypes.txt | 3 + .../comparable/equalityWithUnionTypes01.txt | 3 + .../narrowingConstrainedTypeVariable.txt | 15 ++ .../arrayLiteralsWithRecursiveGenerics.txt | 6 + .../infiniteExpansionThroughTypeInference.txt | 2 + .../recursiveTypeInGenericConstraint.txt | 6 + ...recursiveTypesUsedAsFunctionParameters.txt | 10 + .../subtypingWithCallSignatures3.txt | 4 + .../subtypingWithConstructSignatures3.txt | 4 + .../subtypingWithObjectMembersOptionality.txt | 3 + ...subtypingWithObjectMembersOptionality3.txt | 4 + ...subtypingWithObjectMembersOptionality4.txt | 4 + .../objectTypesIdentity.txt | 24 +++ .../objectTypesIdentity2.txt | 18 ++ .../objectTypesIdentityWithCallSignatures.txt | 29 +++ ...objectTypesIdentityWithCallSignatures2.txt | 29 +++ ...WithCallSignaturesDifferingParamCounts.txt | 29 +++ ...ithCallSignaturesDifferingParamCounts2.txt | 9 + ...dentityWithCallSignaturesWithOverloads.txt | 36 ++++ ...ectTypesIdentityWithComplexConstraints.txt | 1 + ...ctTypesIdentityWithConstructSignatures.txt | 26 +++ ...tTypesIdentityWithConstructSignatures2.txt | 21 ++ ...onstructSignaturesDifferingParamCounts.txt | 21 ++ ...TypesIdentityWithGenericCallSignatures.txt | 29 +++ ...ypesIdentityWithGenericCallSignatures2.txt | 29 +++ ...icCallSignaturesDifferingByConstraints.txt | 29 +++ ...cCallSignaturesDifferingByConstraints2.txt | 34 ++++ ...cCallSignaturesDifferingByConstraints3.txt | 38 ++++ ...ricCallSignaturesDifferingByReturnType.txt | 29 +++ ...icCallSignaturesDifferingByReturnType2.txt | 29 +++ ...SignaturesDifferingTypeParameterCounts.txt | 29 +++ ...ignaturesDifferingTypeParameterCounts2.txt | 8 + ...lSignaturesDifferingTypeParameterNames.txt | 29 +++ ...ithGenericCallSignaturesOptionalParams.txt | 29 +++ ...thGenericCallSignaturesOptionalParams2.txt | 29 +++ ...thGenericCallSignaturesOptionalParams3.txt | 29 +++ ...structSignaturesDifferingByConstraints.txt | 20 ++ ...tructSignaturesDifferingByConstraints2.txt | 25 +++ ...tructSignaturesDifferingByConstraints3.txt | 29 +++ ...nstructSignaturesDifferingByReturnType.txt | 22 +++ ...structSignaturesDifferingByReturnType2.txt | 21 ++ ...SignaturesDifferingTypeParameterCounts.txt | 20 ++ ...tSignaturesDifferingTypeParameterNames.txt | 20 ++ ...nericConstructSignaturesOptionalParams.txt | 20 ++ ...ericConstructSignaturesOptionalParams2.txt | 20 ++ ...ericConstructSignaturesOptionalParams3.txt | 20 ++ .../objectTypesIdentityWithOptionality.txt | 16 ++ .../objectTypesIdentityWithPrivates.txt | 32 +++ .../objectTypesIdentityWithPrivates2.txt | 9 + .../objectTypesIdentityWithPublics.txt | 24 +++ .../primtiveTypesAreIdentical.txt | 7 + ...typeParametersAreIdenticalToThemselves.txt | 30 +++ .../genericCallTypeArgumentInference.txt | 23 +++ .../genericCallWithArrayLiteralArgs.txt | 1 + ...llWithConstraintsTypeArgumentInference.txt | 30 +++ ...genericCallWithFunctionTypedArguments3.txt | 3 + ...nericCallWithObjectTypeArgsAndIndexers.txt | 4 + ...allWithObjectTypeArgsAndIndexersErrors.txt | 5 + ...allWithObjectTypeArgsAndNumericIndexer.txt | 8 + ...CallWithObjectTypeArgsAndStringIndexer.txt | 8 + ...ithOverloadedConstructorTypedArguments.txt | 13 ++ ...llWithOverloadedFunctionTypedArguments.txt | 10 + ...cClassWithObjectTypeArgsAndConstraints.txt | 16 ++ .../keyofInferenceLowerPriorityThanReturn.txt | 12 ++ .../unionAndIntersectionInference1.txt | 11 ++ .../unionAndIntersectionInference2.txt | 6 + ...textualTypeWithUnionTypeCallSignatures.txt | 9 + ...extualTypeWithUnionTypeIndexSignatures.txt | 10 + .../contextualTypeWithUnionTypeMembers.txt | 14 ++ .../types/union/unionTypeCallSignatures2.txt | 6 + .../types/union/unionTypeCallSignatures3.txt | 10 + .../types/union/unionTypeIndexSignature.txt | 11 ++ .../expect/types/union/unionTypeReduction.txt | 3 + testTs/skip_tests.json | 186 ------------------ 187 files changed, 2204 insertions(+), 186 deletions(-) create mode 100644 testTs/expect/types/any/assignEveryTypeToAny.txt create mode 100644 testTs/expect/types/conditional/variance.txt create mode 100644 testTs/expect/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializer.txt create mode 100644 testTs/expect/types/contextualTypes/methodDeclarations/contextuallyTypedObjectLiteralMethodDeclaration01.txt create mode 100644 testTs/expect/types/import/importTypeAmbient.txt create mode 100644 testTs/expect/types/intersection/intersectionThisTypes.txt create mode 100644 testTs/expect/types/intersection/operatorsAndIntersectionTypes.txt create mode 100644 testTs/expect/types/keyof/keyofAndIndexedAccess.txt create mode 100644 testTs/expect/types/literal/booleanLiteralTypes1.txt create mode 100644 testTs/expect/types/literal/booleanLiteralTypes2.txt create mode 100644 testTs/expect/types/literal/enumLiteralTypes1.txt create mode 100644 testTs/expect/types/literal/enumLiteralTypes2.txt create mode 100644 testTs/expect/types/literal/literalTypes1.txt create mode 100644 testTs/expect/types/literal/literalTypes2.txt create mode 100644 testTs/expect/types/literal/literalTypes3.txt create mode 100644 testTs/expect/types/literal/numericLiteralTypes1.txt create mode 100644 testTs/expect/types/literal/numericLiteralTypes2.txt create mode 100644 testTs/expect/types/literal/stringEnumLiteralTypes1.txt create mode 100644 testTs/expect/types/literal/stringEnumLiteralTypes2.txt create mode 100644 testTs/expect/types/localTypes/localTypes2.txt create mode 100644 testTs/expect/types/localTypes/localTypes3.txt create mode 100644 testTs/expect/types/mapped/isomorphicMappedTypeInference.txt create mode 100644 testTs/expect/types/mapped/mappedTypeModifiers.txt create mode 100644 testTs/expect/types/mapped/mappedTypes2.txt create mode 100644 testTs/expect/types/mapped/mappedTypes3.txt create mode 100644 testTs/expect/types/mapped/mappedTypesAndObjects.txt create mode 100644 testTs/expect/types/mapped/mappedTypesArraysTuples.txt create mode 100644 testTs/expect/types/members/classWithProtectedProperty.txt create mode 100644 testTs/expect/types/members/classWithPublicProperty.txt create mode 100644 testTs/expect/types/members/objectTypeWithCallSignatureAppearsToBeFunctionType.txt create mode 100644 testTs/expect/types/members/objectTypeWithCallSignatureHidingMembersOfFunction.txt create mode 100644 testTs/expect/types/members/objectTypeWithConstructSignatureHidingMembersOfFunction.txt create mode 100644 testTs/expect/types/members/typesWithOptionalProperty.txt create mode 100644 testTs/expect/types/members/typesWithSpecializedCallSignatures.txt create mode 100644 testTs/expect/types/members/typesWithSpecializedConstructSignatures.txt create mode 100644 testTs/expect/types/namedTypes/classWithOptionalParameter.txt create mode 100644 testTs/expect/types/namedTypes/genericInstantiationEquivalentToObjectLiteral.txt create mode 100644 testTs/expect/types/namedTypes/optionalMethods.txt create mode 100644 testTs/expect/types/never/neverType.txt create mode 100644 testTs/expect/types/objectTypeLiteral/callSignatures/callSignatureWithoutAnnotationsOrBody.txt create mode 100644 testTs/expect/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType.txt create mode 100644 testTs/expect/types/objectTypeLiteral/callSignatures/identicalCallSignatures.txt create mode 100644 testTs/expect/types/objectTypeLiteral/callSignatures/parametersWithNoAnnotationAreAny.txt create mode 100644 testTs/expect/types/objectTypeLiteral/callSignatures/specializedSignatureIsSubtypeOfNonSpecializedSignature.txt create mode 100644 testTs/expect/types/objectTypeLiteral/callSignatures/stringLiteralTypesInImplementationSignatures.txt create mode 100644 testTs/expect/types/objectTypeLiteral/callSignatures/typeParameterAsTypeArgument.txt create mode 100644 testTs/expect/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.txt create mode 100644 testTs/expect/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.txt create mode 100644 testTs/expect/types/objectTypeLiteral/constructSignatures/constructSignaturesWithIdenticalOverloads.txt create mode 100644 testTs/expect/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloads.txt create mode 100644 testTs/expect/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.txt create mode 100644 testTs/expect/types/objectTypeLiteral/indexSignatures/stringIndexingResults.txt create mode 100644 testTs/expect/types/objectTypeLiteral/methodSignatures/functionLiterals.txt create mode 100644 testTs/expect/types/objectTypeLiteral/methodSignatures/methodSignaturesWithOverloads2.txt create mode 100644 testTs/expect/types/objectTypeLiteral/objectTypeLiteralSyntax.txt create mode 100644 testTs/expect/types/objectTypeLiteral/propertySignatures/propertyNameWithoutTypeAnnotation.txt create mode 100644 testTs/expect/types/objectTypeLiteral/propertySignatures/propertyNamesOfReservedWords.txt create mode 100644 testTs/expect/types/primitives/undefined/invalidUndefinedValues.txt create mode 100644 testTs/expect/types/rest/objectRest2.txt create mode 100644 testTs/expect/types/rest/objectRestAssignment.txt create mode 100644 testTs/expect/types/rest/objectRestForOf.txt create mode 100644 testTs/expect/types/rest/objectRestParameter.txt create mode 100644 testTs/expect/types/specifyingTypes/typeLiterals/arrayLiteral.txt create mode 100644 testTs/expect/types/specifyingTypes/typeLiterals/functionLiteral.txt create mode 100644 testTs/expect/types/specifyingTypes/typeLiterals/functionLiteralForOverloads.txt create mode 100644 testTs/expect/types/specifyingTypes/typeLiterals/functionLiteralForOverloads2.txt create mode 100644 testTs/expect/types/specifyingTypes/typeLiterals/parenthesizedTypes.txt create mode 100644 testTs/expect/types/specifyingTypes/typeQueries/typeofClass2.txt create mode 100644 testTs/expect/types/specifyingTypes/typeQueries/typeofModuleWithoutExports.txt create mode 100644 testTs/expect/types/spread/objectSpreadRepeatedNullCheckPerf.txt create mode 100644 testTs/expect/types/spread/spreadOverwritesProperty.txt create mode 100644 testTs/expect/types/spread/spreadUnion.txt create mode 100644 testTs/expect/types/stringLiteral/stringLiteralTypesAndParenthesizedExpressions01.txt create mode 100644 testTs/expect/types/stringLiteral/stringLiteralTypesAndTuples01.txt create mode 100644 testTs/expect/types/stringLiteral/stringLiteralTypesAsTags01.txt create mode 100644 testTs/expect/types/stringLiteral/stringLiteralTypesAsTags02.txt create mode 100644 testTs/expect/types/stringLiteral/stringLiteralTypesAsTags03.txt create mode 100644 testTs/expect/types/stringLiteral/stringLiteralTypesOverloads01.txt create mode 100644 testTs/expect/types/stringLiteral/stringLiteralTypesOverloads02.txt create mode 100644 testTs/expect/types/stringLiteral/stringLiteralTypesOverloads03.txt create mode 100644 testTs/expect/types/thisType/contextualThisType.txt create mode 100644 testTs/expect/types/thisType/fluentInterfaces.txt create mode 100644 testTs/expect/types/thisType/thisTypeAndConstraints.txt create mode 100644 testTs/expect/types/thisType/thisTypeInClasses.txt create mode 100644 testTs/expect/types/thisType/thisTypeInFunctions3.txt create mode 100644 testTs/expect/types/thisType/thisTypeInObjectLiterals.txt create mode 100644 testTs/expect/types/tuple/tupleElementTypes2.txt create mode 100644 testTs/expect/types/tuple/tupleElementTypes4.txt create mode 100644 testTs/expect/types/tuple/typeInferenceWithTupleType.txt create mode 100644 testTs/expect/types/typeAliases/circularTypeAliasForUnionWithClass.txt create mode 100644 testTs/expect/types/typeAliases/genericTypeAliases.txt create mode 100644 testTs/expect/types/typeAliases/typeAliases.txt create mode 100644 testTs/expect/types/typeParameters/typeArgumentLists/callGenericFunctionWithZeroTypeArguments.txt create mode 100644 testTs/expect/types/typeParameters/typeArgumentLists/constraintSatisfactionWithAny.txt create mode 100644 testTs/expect/types/typeParameters/typeArgumentLists/constraintSatisfactionWithEmptyObject.txt create mode 100644 testTs/expect/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction.txt create mode 100644 testTs/expect/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction3.txt create mode 100644 testTs/expect/types/typeParameters/typeArgumentLists/instantiateGenericClassWithZeroTypeArguments.txt create mode 100644 testTs/expect/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint.txt create mode 100644 testTs/expect/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraintTransitively.txt create mode 100644 testTs/expect/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraintTransitively2.txt create mode 100644 testTs/expect/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints.txt create mode 100644 testTs/expect/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints2.txt create mode 100644 testTs/expect/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints3.txt create mode 100644 testTs/expect/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints3.txt create mode 100644 testTs/expect/types/typeParameters/typeParameterLists/typeParametersAvailableInNestedScope.txt create mode 100644 testTs/expect/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType.txt create mode 100644 testTs/expect/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers.txt create mode 100644 testTs/expect/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers3.txt create mode 100644 testTs/expect/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersNumericNames.txt create mode 100644 testTs/expect/types/typeRelationships/assignmentCompatibility/everyTypeAssignableToAny.txt create mode 100644 testTs/expect/types/typeRelationships/assignmentCompatibility/nullAssignableToEveryType.txt create mode 100644 testTs/expect/types/typeRelationships/assignmentCompatibility/undefinedAssignableToEveryType.txt create mode 100644 testTs/expect/types/typeRelationships/bestCommonType/arrayLiteralWithMultipleBestCommonTypes.txt create mode 100644 testTs/expect/types/typeRelationships/comparable/equalityWithUnionTypes01.txt create mode 100644 testTs/expect/types/typeRelationships/instanceOf/narrowingConstrainedTypeVariable.txt create mode 100644 testTs/expect/types/typeRelationships/recursiveTypes/arrayLiteralsWithRecursiveGenerics.txt create mode 100644 testTs/expect/types/typeRelationships/recursiveTypes/infiniteExpansionThroughTypeInference.txt create mode 100644 testTs/expect/types/typeRelationships/recursiveTypes/recursiveTypeInGenericConstraint.txt create mode 100644 testTs/expect/types/typeRelationships/recursiveTypes/recursiveTypesUsedAsFunctionParameters.txt create mode 100644 testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignatures3.txt create mode 100644 testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures3.txt create mode 100644 testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality.txt create mode 100644 testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality3.txt create mode 100644 testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality4.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentity.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentity2.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures2.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesDifferingParamCounts.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesWithOverloads.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithComplexConstraints.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignatures.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignatures2.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignatures.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignatures2.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithOptionality.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates2.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPublics.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/primtiveTypesAreIdentical.txt create mode 100644 testTs/expect/types/typeRelationships/typeAndMemberIdentity/typeParametersAreIdenticalToThemselves.txt create mode 100644 testTs/expect/types/typeRelationships/typeInference/genericCallTypeArgumentInference.txt create mode 100644 testTs/expect/types/typeRelationships/typeInference/genericCallWithArrayLiteralArgs.txt create mode 100644 testTs/expect/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference.txt create mode 100644 testTs/expect/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments3.txt create mode 100644 testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexers.txt create mode 100644 testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.txt create mode 100644 testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndNumericIndexer.txt create mode 100644 testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndStringIndexer.txt create mode 100644 testTs/expect/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments.txt create mode 100644 testTs/expect/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments.txt create mode 100644 testTs/expect/types/typeRelationships/typeInference/genericClassWithObjectTypeArgsAndConstraints.txt create mode 100644 testTs/expect/types/typeRelationships/typeInference/keyofInferenceLowerPriorityThanReturn.txt create mode 100644 testTs/expect/types/typeRelationships/typeInference/unionAndIntersectionInference1.txt create mode 100644 testTs/expect/types/typeRelationships/typeInference/unionAndIntersectionInference2.txt create mode 100644 testTs/expect/types/union/contextualTypeWithUnionTypeCallSignatures.txt create mode 100644 testTs/expect/types/union/contextualTypeWithUnionTypeIndexSignatures.txt create mode 100644 testTs/expect/types/union/contextualTypeWithUnionTypeMembers.txt create mode 100644 testTs/expect/types/union/unionTypeCallSignatures2.txt create mode 100644 testTs/expect/types/union/unionTypeCallSignatures3.txt create mode 100644 testTs/expect/types/union/unionTypeIndexSignature.txt create mode 100644 testTs/expect/types/union/unionTypeReduction.txt diff --git a/testTs/expect/types/any/assignEveryTypeToAny.txt b/testTs/expect/types/any/assignEveryTypeToAny.txt new file mode 100644 index 0000000000..4abbb558a0 --- /dev/null +++ b/testTs/expect/types/any/assignEveryTypeToAny.txt @@ -0,0 +1,5 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'j'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/conditional/variance.txt b/testTs/expect/types/conditional/variance.txt new file mode 100644 index 0000000000..28df9da773 --- /dev/null +++ b/testTs/expect/types/conditional/variance.txt @@ -0,0 +1,6 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'prop'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'cast'}, {'t': 2, 'v': 105}, {'t': 5, 'v': 'pushThis'}, {'t': 2, 'v': 106}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'instance'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'cast'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'pushThis'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializer.txt b/testTs/expect/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializer.txt new file mode 100644 index 0000000000..ffa4c64d90 --- /dev/null +++ b/testTs/expect/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializer.txt @@ -0,0 +1,13 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'show'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'ff'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 106}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'nested'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'prop'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'h'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 110}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'prop'}, {'t': 2, 'v': 111}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 113}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'stringIdentity'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} diff --git a/testTs/expect/types/contextualTypes/methodDeclarations/contextuallyTypedObjectLiteralMethodDeclaration01.txt b/testTs/expect/types/contextualTypes/methodDeclarations/contextuallyTypedObjectLiteralMethodDeclaration01.txt new file mode 100644 index 0000000000..3264272d44 --- /dev/null +++ b/testTs/expect/types/contextualTypes/methodDeclarations/contextuallyTypedObjectLiteralMethodDeclaration01.txt @@ -0,0 +1,8 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'getFoo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 103}, {'t': 2, 'v': 105}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'method1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 104}, {'t': 2, 'v': 3}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'numProp'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'method2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 106}, {'t': 2, 'v': 3}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'strProp'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'getFoo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'getFoo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 102}]} diff --git a/testTs/expect/types/import/importTypeAmbient.txt b/testTs/expect/types/import/importTypeAmbient.txt new file mode 100644 index 0000000000..93dcc40497 --- /dev/null +++ b/testTs/expect/types/import/importTypeAmbient.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'item'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 3}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'c'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} diff --git a/testTs/expect/types/intersection/intersectionThisTypes.txt b/testTs/expect/types/intersection/intersectionThisTypes.txt new file mode 100644 index 0000000000..6ed7e2067e --- /dev/null +++ b/testTs/expect/types/intersection/intersectionThisTypes.txt @@ -0,0 +1,7 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'c'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'test'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 106}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'title'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'extend'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/intersection/operatorsAndIntersectionTypes.txt b/testTs/expect/types/intersection/operatorsAndIntersectionTypes.txt new file mode 100644 index 0000000000..e75311f4c9 --- /dev/null +++ b/testTs/expect/types/intersection/operatorsAndIntersectionTypes.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'createGuid'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'createSerialNo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} diff --git a/testTs/expect/types/keyof/keyofAndIndexedAccess.txt b/testTs/expect/types/keyof/keyofAndIndexedAccess.txt new file mode 100644 index 0000000000..365bcb6070 --- /dev/null +++ b/testTs/expect/types/keyof/keyofAndIndexedAccess.txt @@ -0,0 +1,121 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'name'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'width'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'height'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'visible'}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'tag'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'name'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'price'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'visible'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'getProperty'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'setProperty'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 109}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 111}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 109}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'props'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'getProperty'}, {'t': 2, 'v': 115}, {'t': 5, 'v': 'setProperty'}, {'t': 2, 'v': 116}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'getProperty'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'setProperty'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 114}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f20'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 117}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'pluck'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 120}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f30'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 111}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f31'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f32'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f33'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f34'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 126}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'z'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f40'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 129}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 127}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f50'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f51'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f52'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 2, 'v': 133}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f53'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 2, 'v': 135}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f54'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f55'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f60'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f70'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f71'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f72'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f73'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f74'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f80'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f81'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f82'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f83'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f84'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 5, 'v': 'get'}, {'t': 2, 'v': 150}, {'t': 5, 'v': 'set'}, {'t': 2, 'v': 151}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 152}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'get'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'set'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 149}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f90'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f91'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f92'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 159}, {'t': 2, 'v': 6}, {'t': 2, 'v': 7}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'get'}, {'t': 2, 'v': 161}, {'t': 5, 'v': 'set'}, {'t': 2, 'v': 162}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'get'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'set'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 160}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 160}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'parts'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 165}, {'t': 5, 'v': 'getParts'}, {'t': 2, 'v': 166}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'getParts'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 164}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'parts'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 169}, {'t': 5, 'v': 'getParts'}, {'t': 2, 'v': 170}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'getParts'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 168}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'path'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 174}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 173}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 177}, {'t': 5, 'v': 'get'}, {'t': 2, 'v': 179}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 178}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'data'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'computed'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'get'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 176}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'addToMyThingy'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'onChangeGenericFunction'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'updateIds'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 120}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 7}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'updateIds2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 187}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'props'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 188}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 190}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 189}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'childFormFactories'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'set'}, {'t': 2, 'v': 193}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'set'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 192}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'props'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 196}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 195}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 195}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 200}, {'t': 5, 'v': 'brokenMethod'}, {'t': 2, 'v': 201}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'brokenMethod'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 199}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'getFlagsFromSimpleRecord'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 120}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'getFlagsFromDynamicRecord'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 120}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'fn'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 208}, {'t': 2, 'v': 7}, {'t': 2, 'v': 6}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 210}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 209}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'ff1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'ff2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 217}, {'t': 5, 'v': 'get'}, {'t': 2, 'v': 219}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 218}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'data'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'computed'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'get'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 216}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 188}]} diff --git a/testTs/expect/types/literal/booleanLiteralTypes1.txt b/testTs/expect/types/literal/booleanLiteralTypes1.txt new file mode 100644 index 0000000000..c9429a4782 --- /dev/null +++ b/testTs/expect/types/literal/booleanLiteralTypes1.txt @@ -0,0 +1,14 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 2}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 2}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 102}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 102}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 2}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'assertNever'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f20'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f21'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/literal/booleanLiteralTypes2.txt b/testTs/expect/types/literal/booleanLiteralTypes2.txt new file mode 100644 index 0000000000..c9429a4782 --- /dev/null +++ b/testTs/expect/types/literal/booleanLiteralTypes2.txt @@ -0,0 +1,14 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 2}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 2}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 102}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 102}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 2}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'assertNever'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f20'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f21'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/literal/enumLiteralTypes1.txt b/testTs/expect/types/literal/enumLiteralTypes1.txt new file mode 100644 index 0000000000..034ac2b4af --- /dev/null +++ b/testTs/expect/types/literal/enumLiteralTypes1.txt @@ -0,0 +1,14 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 76}, {'t': 2, 'v': 76}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 76}, {'t': 2, 'v': 76}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 76}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 76}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'assertNever'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f20'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f21'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/literal/enumLiteralTypes2.txt b/testTs/expect/types/literal/enumLiteralTypes2.txt new file mode 100644 index 0000000000..034ac2b4af --- /dev/null +++ b/testTs/expect/types/literal/enumLiteralTypes2.txt @@ -0,0 +1,14 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 76}, {'t': 2, 'v': 76}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 76}, {'t': 2, 'v': 76}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 76}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 76}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'assertNever'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f20'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f21'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/literal/literalTypes1.txt b/testTs/expect/types/literal/literalTypes1.txt new file mode 100644 index 0000000000..66bca36503 --- /dev/null +++ b/testTs/expect/types/literal/literalTypes1.txt @@ -0,0 +1,9 @@ +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 107}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 109}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}, {'t': 2, 'v': 2}]} diff --git a/testTs/expect/types/literal/literalTypes2.txt b/testTs/expect/types/literal/literalTypes2.txt new file mode 100644 index 0000000000..63b825cb7d --- /dev/null +++ b/testTs/expect/types/literal/literalTypes2.txt @@ -0,0 +1,29 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 76}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'kind'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 16}, {'t': 5, 'v': 'x1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'x2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'x3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'x4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'x5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'x6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'x7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'x8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'c1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'c2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'c3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'c4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'c5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'c6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'c7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'c8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 105}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 109}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 110}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 109}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 110}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 113}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 120}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 121}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 119}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f20'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 125}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'makeArray'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 128}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'append'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 128}, {'t': 2, 'v': 0}, {'t': 2, 'v': 128}]} diff --git a/testTs/expect/types/literal/literalTypes3.txt b/testTs/expect/types/literal/literalTypes3.txt new file mode 100644 index 0000000000..e066fd121b --- /dev/null +++ b/testTs/expect/types/literal/literalTypes3.txt @@ -0,0 +1,11 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 106}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 106}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 109}, {'t': 2, 'v': 110}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 109}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/literal/numericLiteralTypes1.txt b/testTs/expect/types/literal/numericLiteralTypes1.txt new file mode 100644 index 0000000000..e1836bdbf2 --- /dev/null +++ b/testTs/expect/types/literal/numericLiteralTypes1.txt @@ -0,0 +1,17 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'assertNever'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 104}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 114}, {'t': 2, 'v': 115}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f20'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f21'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/literal/numericLiteralTypes2.txt b/testTs/expect/types/literal/numericLiteralTypes2.txt new file mode 100644 index 0000000000..e1836bdbf2 --- /dev/null +++ b/testTs/expect/types/literal/numericLiteralTypes2.txt @@ -0,0 +1,17 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'assertNever'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 104}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 114}, {'t': 2, 'v': 115}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f20'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f21'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/literal/stringEnumLiteralTypes1.txt b/testTs/expect/types/literal/stringEnumLiteralTypes1.txt new file mode 100644 index 0000000000..958b0396ef --- /dev/null +++ b/testTs/expect/types/literal/stringEnumLiteralTypes1.txt @@ -0,0 +1,13 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 76}, {'t': 2, 'v': 76}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 76}, {'t': 2, 'v': 76}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 76}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'assertNever'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f20'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f21'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/literal/stringEnumLiteralTypes2.txt b/testTs/expect/types/literal/stringEnumLiteralTypes2.txt new file mode 100644 index 0000000000..958b0396ef --- /dev/null +++ b/testTs/expect/types/literal/stringEnumLiteralTypes2.txt @@ -0,0 +1,13 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 76}, {'t': 2, 'v': 76}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 76}, {'t': 2, 'v': 76}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 76}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'assertNever'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f20'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f21'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/localTypes/localTypes2.txt b/testTs/expect/types/localTypes/localTypes2.txt new file mode 100644 index 0000000000..07f5321c2a --- /dev/null +++ b/testTs/expect/types/localTypes/localTypes2.txt @@ -0,0 +1,14 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 109}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 108}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 113}]} diff --git a/testTs/expect/types/localTypes/localTypes3.txt b/testTs/expect/types/localTypes/localTypes3.txt new file mode 100644 index 0000000000..9a6dfd6293 --- /dev/null +++ b/testTs/expect/types/localTypes/localTypes3.txt @@ -0,0 +1,14 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 109}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 108}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 113}]} diff --git a/testTs/expect/types/mapped/isomorphicMappedTypeInference.txt b/testTs/expect/types/mapped/isomorphicMappedTypeInference.txt new file mode 100644 index 0000000000..49bd09a873 --- /dev/null +++ b/testTs/expect/types/mapped/isomorphicMappedTypeInference.txt @@ -0,0 +1,19 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'box'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'unbox'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'boxify'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'unboxify'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'assignBoxified'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'makeRecord'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'makeDictionary'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 114}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'getProps'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 118}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/mapped/mappedTypeModifiers.txt b/testTs/expect/types/mapped/mappedTypeModifiers.txt new file mode 100644 index 0000000000..f8295477c8 --- /dev/null +++ b/testTs/expect/types/mapped/mappedTypeModifiers.txt @@ -0,0 +1,5 @@ +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/mapped/mappedTypes2.txt b/testTs/expect/types/mapped/mappedTypes2.txt new file mode 100644 index 0000000000..636350e5bd --- /dev/null +++ b/testTs/expect/types/mapped/mappedTypes2.txt @@ -0,0 +1,12 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'verifyLibTypes'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f0'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 103}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'name'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'width'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'height'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'location'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'name'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'width'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'height'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'location'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'name'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'width'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'height'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'location'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/mapped/mappedTypes3.txt b/testTs/expect/types/mapped/mappedTypes3.txt new file mode 100644 index 0000000000..84cb623f83 --- /dev/null +++ b/testTs/expect/types/mapped/mappedTypes3.txt @@ -0,0 +1,7 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'value'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'isPerfect'}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'weight'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 106}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'isPerfect'}, {'t': 2, 'v': 107}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'weight'}, {'t': 2, 'v': 107}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} diff --git a/testTs/expect/types/mapped/mappedTypesAndObjects.txt b/testTs/expect/types/mapped/mappedTypesAndObjects.txt new file mode 100644 index 0000000000..80cde4bf3e --- /dev/null +++ b/testTs/expect/types/mapped/mappedTypesAndObjects.txt @@ -0,0 +1,7 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'values'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 106}]} diff --git a/testTs/expect/types/mapped/mappedTypesArraysTuples.txt b/testTs/expect/types/mapped/mappedTypesArraysTuples.txt new file mode 100644 index 0000000000..8b88271264 --- /dev/null +++ b/testTs/expect/types/mapped/mappedTypesArraysTuples.txt @@ -0,0 +1,6 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}, {'t': 2, 'v': 78}, {'t': 2, 'v': 102}, {'t': 2, 'v': 78}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 7}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'acceptMappedArray'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/members/classWithProtectedProperty.txt b/testTs/expect/types/members/classWithProtectedProperty.txt new file mode 100644 index 0000000000..1b890b0718 --- /dev/null +++ b/testTs/expect/types/members/classWithProtectedProperty.txt @@ -0,0 +1,7 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'd'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'c'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'e'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 6}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'method'}, {'t': 2, 'v': 106}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'method'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 105}]} diff --git a/testTs/expect/types/members/classWithPublicProperty.txt b/testTs/expect/types/members/classWithPublicProperty.txt new file mode 100644 index 0000000000..9c38b8bee3 --- /dev/null +++ b/testTs/expect/types/members/classWithPublicProperty.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'd'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'c'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'e'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} diff --git a/testTs/expect/types/members/objectTypeWithCallSignatureAppearsToBeFunctionType.txt b/testTs/expect/types/members/objectTypeWithCallSignatureAppearsToBeFunctionType.txt new file mode 100644 index 0000000000..9d5aac1701 --- /dev/null +++ b/testTs/expect/types/members/objectTypeWithCallSignatureAppearsToBeFunctionType.txt @@ -0,0 +1,2 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 3}]} diff --git a/testTs/expect/types/members/objectTypeWithCallSignatureHidingMembersOfFunction.txt b/testTs/expect/types/members/objectTypeWithCallSignatureHidingMembersOfFunction.txt new file mode 100644 index 0000000000..38a11ff211 --- /dev/null +++ b/testTs/expect/types/members/objectTypeWithCallSignatureHidingMembersOfFunction.txt @@ -0,0 +1,5 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 102}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'apply'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'call'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 3}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 3}, {'t': 5, 'v': 'apply'}, {'t': 2, 'v': 3}, {'t': 5, 'v': 'call'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/members/objectTypeWithConstructSignatureHidingMembersOfFunction.txt b/testTs/expect/types/members/objectTypeWithConstructSignatureHidingMembersOfFunction.txt new file mode 100644 index 0000000000..9300569e78 --- /dev/null +++ b/testTs/expect/types/members/objectTypeWithConstructSignatureHidingMembersOfFunction.txt @@ -0,0 +1,5 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 102}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'apply'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'call'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 3}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'apply'}, {'t': 2, 'v': 3}, {'t': 5, 'v': 'call'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/members/typesWithOptionalProperty.txt b/testTs/expect/types/members/typesWithOptionalProperty.txt new file mode 100644 index 0000000000..8a64e87758 --- /dev/null +++ b/testTs/expect/types/members/typesWithOptionalProperty.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 3}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} diff --git a/testTs/expect/types/members/typesWithSpecializedCallSignatures.txt b/testTs/expect/types/members/typesWithSpecializedCallSignatures.txt new file mode 100644 index 0000000000..ba55699ec4 --- /dev/null +++ b/testTs/expect/types/members/typesWithSpecializedCallSignatures.txt @@ -0,0 +1,17 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 111}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 106}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 108}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 110}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 114}, {'t': 2, 'v': 115}, {'t': 2, 'v': 116}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 106}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 108}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 110}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 110}]} diff --git a/testTs/expect/types/members/typesWithSpecializedConstructSignatures.txt b/testTs/expect/types/members/typesWithSpecializedConstructSignatures.txt new file mode 100644 index 0000000000..2851761ca2 --- /dev/null +++ b/testTs/expect/types/members/typesWithSpecializedConstructSignatures.txt @@ -0,0 +1,14 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 114}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} diff --git a/testTs/expect/types/namedTypes/classWithOptionalParameter.txt b/testTs/expect/types/namedTypes/classWithOptionalParameter.txt new file mode 100644 index 0000000000..bd99638dc9 --- /dev/null +++ b/testTs/expect/types/namedTypes/classWithOptionalParameter.txt @@ -0,0 +1,6 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} diff --git a/testTs/expect/types/namedTypes/genericInstantiationEquivalentToObjectLiteral.txt b/testTs/expect/types/namedTypes/genericInstantiationEquivalentToObjectLiteral.txt new file mode 100644 index 0000000000..1f83f0a15b --- /dev/null +++ b/testTs/expect/types/namedTypes/genericInstantiationEquivalentToObjectLiteral.txt @@ -0,0 +1,2 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'first'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'second'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'first'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'second'}, {'t': 2, 'v': 1}]} diff --git a/testTs/expect/types/namedTypes/optionalMethods.txt b/testTs/expect/types/namedTypes/optionalMethods.txt new file mode 100644 index 0000000000..6c0428899d --- /dev/null +++ b/testTs/expect/types/namedTypes/optionalMethods.txt @@ -0,0 +1,16 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'test1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 103}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 106}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 107}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 108}, {'t': 5, 'v': 'h'}, {'t': 2, 'v': 109}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'h'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 105}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'test2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 110}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 113}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 112}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 115}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 114}]} diff --git a/testTs/expect/types/never/neverType.txt b/testTs/expect/types/never/neverType.txt new file mode 100644 index 0000000000..fca342b053 --- /dev/null +++ b/testTs/expect/types/never/neverType.txt @@ -0,0 +1,21 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'error'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'errorVoid'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'fail'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'failOrThrow'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'infiniteLoop1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'infiniteLoop2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'move1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'move2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'check'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 111}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 7}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'void1'}, {'t': 2, 'v': 113}, {'t': 5, 'v': 'void2'}, {'t': 2, 'v': 114}, {'t': 5, 'v': 'never1'}, {'t': 2, 'v': 115}, {'t': 5, 'v': 'never2'}, {'t': 2, 'v': 116}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'void1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'void2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'never1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'never2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 112}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 119}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 119}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'test'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/objectTypeLiteral/callSignatures/callSignatureWithoutAnnotationsOrBody.txt b/testTs/expect/types/objectTypeLiteral/callSignatures/callSignatureWithoutAnnotationsOrBody.txt new file mode 100644 index 0000000000..3099ba1d11 --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/callSignatures/callSignatureWithoutAnnotationsOrBody.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType.txt b/testTs/expect/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType.txt new file mode 100644 index 0000000000..690ce89b36 --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType.txt @@ -0,0 +1,2 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} diff --git a/testTs/expect/types/objectTypeLiteral/callSignatures/identicalCallSignatures.txt b/testTs/expect/types/objectTypeLiteral/callSignatures/identicalCallSignatures.txt new file mode 100644 index 0000000000..f0c3a5cd55 --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/callSignatures/identicalCallSignatures.txt @@ -0,0 +1 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/objectTypeLiteral/callSignatures/parametersWithNoAnnotationAreAny.txt b/testTs/expect/types/objectTypeLiteral/callSignatures/parametersWithNoAnnotationAreAny.txt new file mode 100644 index 0000000000..51b2459819 --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/callSignatures/parametersWithNoAnnotationAreAny.txt @@ -0,0 +1,5 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/objectTypeLiteral/callSignatures/specializedSignatureIsSubtypeOfNonSpecializedSignature.txt b/testTs/expect/types/objectTypeLiteral/callSignatures/specializedSignatureIsSubtypeOfNonSpecializedSignature.txt new file mode 100644 index 0000000000..16f08984dd --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/callSignatures/specializedSignatureIsSubtypeOfNonSpecializedSignature.txt @@ -0,0 +1,21 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 111}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 117}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 113}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/objectTypeLiteral/callSignatures/stringLiteralTypesInImplementationSignatures.txt b/testTs/expect/types/objectTypeLiteral/callSignatures/stringLiteralTypesInImplementationSignatures.txt new file mode 100644 index 0000000000..3d1c0bed8c --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/callSignatures/stringLiteralTypesInImplementationSignatures.txt @@ -0,0 +1,5 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/objectTypeLiteral/callSignatures/typeParameterAsTypeArgument.txt b/testTs/expect/types/objectTypeLiteral/callSignatures/typeParameterAsTypeArgument.txt new file mode 100644 index 0000000000..3502bd093d --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/callSignatures/typeParameterAsTypeArgument.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} diff --git a/testTs/expect/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.txt b/testTs/expect/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.txt new file mode 100644 index 0000000000..8c3e433a61 --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.txt @@ -0,0 +1,2 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.txt b/testTs/expect/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.txt new file mode 100644 index 0000000000..19cf2743b0 --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.txt @@ -0,0 +1,10 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/objectTypeLiteral/constructSignatures/constructSignaturesWithIdenticalOverloads.txt b/testTs/expect/types/objectTypeLiteral/constructSignatures/constructSignaturesWithIdenticalOverloads.txt new file mode 100644 index 0000000000..4070a47b32 --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/constructSignatures/constructSignaturesWithIdenticalOverloads.txt @@ -0,0 +1,14 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 109}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 106}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 105}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 110}]} diff --git a/testTs/expect/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloads.txt b/testTs/expect/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloads.txt new file mode 100644 index 0000000000..4070a47b32 --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloads.txt @@ -0,0 +1,14 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 109}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 106}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 105}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 110}]} diff --git a/testTs/expect/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.txt b/testTs/expect/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.txt new file mode 100644 index 0000000000..6092af3404 --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.txt @@ -0,0 +1,8 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 103}]} diff --git a/testTs/expect/types/objectTypeLiteral/indexSignatures/stringIndexingResults.txt b/testTs/expect/types/objectTypeLiteral/indexSignatures/stringIndexingResults.txt new file mode 100644 index 0000000000..392dcdb757 --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/indexSignatures/stringIndexingResults.txt @@ -0,0 +1,5 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} diff --git a/testTs/expect/types/objectTypeLiteral/methodSignatures/functionLiterals.txt b/testTs/expect/types/objectTypeLiteral/methodSignatures/functionLiterals.txt new file mode 100644 index 0000000000..750f335b4c --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/methodSignatures/functionLiterals.txt @@ -0,0 +1,8 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 3}, {'t': 5, 'v': 'func1'}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'func2'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'func3'}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'func4'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'func5'}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 3}, {'t': 5, 'v': 'func1'}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'func2'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'func3'}, {'t': 2, 'v': 106}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'func4'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'func5'}, {'t': 2, 'v': 108}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} diff --git a/testTs/expect/types/objectTypeLiteral/methodSignatures/methodSignaturesWithOverloads2.txt b/testTs/expect/types/objectTypeLiteral/methodSignatures/methodSignaturesWithOverloads2.txt new file mode 100644 index 0000000000..765dad13e7 --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/methodSignatures/methodSignaturesWithOverloads2.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'func4'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'func5'}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'func4'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'func5'}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} diff --git a/testTs/expect/types/objectTypeLiteral/objectTypeLiteralSyntax.txt b/testTs/expect/types/objectTypeLiteral/objectTypeLiteralSyntax.txt new file mode 100644 index 0000000000..33f736471b --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/objectTypeLiteralSyntax.txt @@ -0,0 +1,2 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}]} diff --git a/testTs/expect/types/objectTypeLiteral/propertySignatures/propertyNameWithoutTypeAnnotation.txt b/testTs/expect/types/objectTypeLiteral/propertySignatures/propertyNameWithoutTypeAnnotation.txt new file mode 100644 index 0000000000..b65ef26b32 --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/propertySignatures/propertyNameWithoutTypeAnnotation.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} diff --git a/testTs/expect/types/objectTypeLiteral/propertySignatures/propertyNamesOfReservedWords.txt b/testTs/expect/types/objectTypeLiteral/propertySignatures/propertyNamesOfReservedWords.txt new file mode 100644 index 0000000000..a4e8c08991 --- /dev/null +++ b/testTs/expect/types/objectTypeLiteral/propertySignatures/propertyNamesOfReservedWords.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 63}, {'t': 5, 'v': 'abstract'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'as'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'boolean'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'break'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'byte'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'case'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'catch'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'char'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'class'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'continue'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'const'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'debugger'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'default'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'delete'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'do'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'double'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'else'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'enum'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'export'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'extends'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'false'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'final'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'finally'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'float'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'for'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'function'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'goto'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'if'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'implements'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'import'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'in'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'instanceof'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'int'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'interface'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'is'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'long'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'namespace'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'native'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'new'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'null'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'package'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'private'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'protected'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'public'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'return'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'short'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'static'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'super'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'switch'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'synchronized'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'this'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'throw'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'throws'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'transient'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'true'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'try'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'typeof'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'use'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'var'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'void'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'volatile'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'while'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'with'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 63}, {'t': 5, 'v': 'abstract'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'as'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'boolean'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'break'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'byte'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'case'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'catch'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'char'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'class'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'continue'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'const'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'debugger'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'default'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'delete'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'do'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'double'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'else'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'enum'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'export'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'extends'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'false'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'final'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'finally'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'float'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'for'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'function'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'goto'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'if'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'implements'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'import'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'in'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'instanceof'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'int'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'interface'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'is'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'long'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'namespace'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'native'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'new'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'null'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'package'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'private'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'protected'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'public'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'return'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'short'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'static'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'super'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'switch'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'synchronized'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'this'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'throw'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'throws'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'transient'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'true'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'try'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'typeof'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'use'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'var'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'void'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'volatile'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'while'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'with'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 63}, {'t': 5, 'v': 'abstract'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'as'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'boolean'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'break'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'byte'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'case'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'catch'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'char'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'class'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'continue'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'const'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'debugger'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'default'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'delete'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'do'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'double'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'else'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'enum'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'export'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'extends'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'false'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'final'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'finally'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'float'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'for'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'function'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'goto'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'if'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'implements'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'import'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'in'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'instanceof'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'int'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'interface'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'is'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'long'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'namespace'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'native'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'new'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'null'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'package'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'private'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'protected'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'public'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'return'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'short'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'static'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'super'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'switch'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'synchronized'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'this'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'throw'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'throws'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'transient'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'true'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'try'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'typeof'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'use'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'var'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'void'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'volatile'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'while'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'with'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/primitives/undefined/invalidUndefinedValues.txt b/testTs/expect/types/primitives/undefined/invalidUndefinedValues.txt new file mode 100644 index 0000000000..4e3f0511ec --- /dev/null +++ b/testTs/expect/types/primitives/undefined/invalidUndefinedValues.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/rest/objectRest2.txt b/testTs/expect/types/rest/objectRest2.txt new file mode 100644 index 0000000000..eebf590640 --- /dev/null +++ b/testTs/expect/types/rest/objectRest2.txt @@ -0,0 +1 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'rootConnection'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/rest/objectRestAssignment.txt b/testTs/expect/types/rest/objectRestAssignment.txt new file mode 100644 index 0000000000..d4498c77a3 --- /dev/null +++ b/testTs/expect/types/rest/objectRestAssignment.txt @@ -0,0 +1,8 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'ki'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 104}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'ka'}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'ki'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 107}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 108}, {'t': 5, 'v': 'ke'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'ko'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'ka'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 106}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 3}, {'t': 5, 'v': 'z'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'ki'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'ku'}, {'t': 2, 'v': 4}]} diff --git a/testTs/expect/types/rest/objectRestForOf.txt b/testTs/expect/types/rest/objectRestForOf.txt new file mode 100644 index 0000000000..a8f1cceafe --- /dev/null +++ b/testTs/expect/types/rest/objectRestForOf.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 4}]} diff --git a/testTs/expect/types/rest/objectRestParameter.txt b/testTs/expect/types/rest/objectRestParameter.txt new file mode 100644 index 0000000000..0df206a3d8 --- /dev/null +++ b/testTs/expect/types/rest/objectRestParameter.txt @@ -0,0 +1,9 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'cloneAgain'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 3}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'm'}, {'t': 2, 'v': 104}, {'t': 5, 'v': 'p'}, {'t': 2, 'v': 106}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'm'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 105}, {'t': 2, 'v': 3}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'p'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 107}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foobar'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/specifyingTypes/typeLiterals/arrayLiteral.txt b/testTs/expect/types/specifyingTypes/typeLiterals/arrayLiteral.txt new file mode 100644 index 0000000000..3ea9cc1736 --- /dev/null +++ b/testTs/expect/types/specifyingTypes/typeLiterals/arrayLiteral.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 44}]} +{'lb': [{'t': 2, 'v': 9}, {'t': 2, 'v': 44}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} diff --git a/testTs/expect/types/specifyingTypes/typeLiterals/functionLiteral.txt b/testTs/expect/types/specifyingTypes/typeLiterals/functionLiteral.txt new file mode 100644 index 0000000000..eb7967719e --- /dev/null +++ b/testTs/expect/types/specifyingTypes/typeLiterals/functionLiteral.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 1}]} diff --git a/testTs/expect/types/specifyingTypes/typeLiterals/functionLiteralForOverloads.txt b/testTs/expect/types/specifyingTypes/typeLiterals/functionLiteralForOverloads.txt new file mode 100644 index 0000000000..4c1ab004db --- /dev/null +++ b/testTs/expect/types/specifyingTypes/typeLiterals/functionLiteralForOverloads.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/specifyingTypes/typeLiterals/functionLiteralForOverloads2.txt b/testTs/expect/types/specifyingTypes/typeLiterals/functionLiteralForOverloads2.txt new file mode 100644 index 0000000000..0b701ab0bf --- /dev/null +++ b/testTs/expect/types/specifyingTypes/typeLiterals/functionLiteralForOverloads2.txt @@ -0,0 +1,13 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 109}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 106}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 105}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 105}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 110}]} diff --git a/testTs/expect/types/specifyingTypes/typeLiterals/parenthesizedTypes.txt b/testTs/expect/types/specifyingTypes/typeLiterals/parenthesizedTypes.txt new file mode 100644 index 0000000000..95531ac5fb --- /dev/null +++ b/testTs/expect/types/specifyingTypes/typeLiterals/parenthesizedTypes.txt @@ -0,0 +1,13 @@ +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 103}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 106}, {'t': 2, 'v': 106}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 108}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 111}, {'t': 2, 'v': 112}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 110}]} diff --git a/testTs/expect/types/specifyingTypes/typeQueries/typeofClass2.txt b/testTs/expect/types/specifyingTypes/typeQueries/typeofClass2.txt new file mode 100644 index 0000000000..a32d18611a --- /dev/null +++ b/testTs/expect/types/specifyingTypes/typeQueries/typeofClass2.txt @@ -0,0 +1,13 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 108}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 109}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 107}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 112}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 111}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 110}]} diff --git a/testTs/expect/types/specifyingTypes/typeQueries/typeofModuleWithoutExports.txt b/testTs/expect/types/specifyingTypes/typeQueries/typeofModuleWithoutExports.txt new file mode 100644 index 0000000000..babb14ec27 --- /dev/null +++ b/testTs/expect/types/specifyingTypes/typeQueries/typeofModuleWithoutExports.txt @@ -0,0 +1 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/spread/objectSpreadRepeatedNullCheckPerf.txt b/testTs/expect/types/spread/objectSpreadRepeatedNullCheckPerf.txt new file mode 100644 index 0000000000..0fbd40e03b --- /dev/null +++ b/testTs/expect/types/spread/objectSpreadRepeatedNullCheckPerf.txt @@ -0,0 +1,2 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'parseWithSpread'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 26}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'c'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'd'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'e'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'h'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'i'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'j'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'k'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'l'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'm'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'n'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'o'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'p'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'q'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'r'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 's'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 't'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'u'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'v'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'w'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'z'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/spread/spreadOverwritesProperty.txt b/testTs/expect/types/spread/spreadOverwritesProperty.txt new file mode 100644 index 0000000000..34385eb42b --- /dev/null +++ b/testTs/expect/types/spread/spreadOverwritesProperty.txt @@ -0,0 +1,5 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 7}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'h'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 1}]} diff --git a/testTs/expect/types/spread/spreadUnion.txt b/testTs/expect/types/spread/spreadUnion.txt new file mode 100644 index 0000000000..14c80c5eef --- /dev/null +++ b/testTs/expect/types/spread/spreadUnion.txt @@ -0,0 +1,10 @@ +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 102}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 105}, {'t': 2, 'v': 106}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 108}, {'t': 2, 'v': 109}, {'t': 2, 'v': 110}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 4}]} diff --git a/testTs/expect/types/stringLiteral/stringLiteralTypesAndParenthesizedExpressions01.txt b/testTs/expect/types/stringLiteral/stringLiteralTypesAndParenthesizedExpressions01.txt new file mode 100644 index 0000000000..a9695ba2c0 --- /dev/null +++ b/testTs/expect/types/stringLiteral/stringLiteralTypesAndParenthesizedExpressions01.txt @@ -0,0 +1 @@ +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} diff --git a/testTs/expect/types/stringLiteral/stringLiteralTypesAndTuples01.txt b/testTs/expect/types/stringLiteral/stringLiteralTypesAndTuples01.txt new file mode 100644 index 0000000000..2219574151 --- /dev/null +++ b/testTs/expect/types/stringLiteral/stringLiteralTypesAndTuples01.txt @@ -0,0 +1 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'rawr'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/stringLiteral/stringLiteralTypesAsTags01.txt b/testTs/expect/types/stringLiteral/stringLiteralTypesAsTags01.txt new file mode 100644 index 0000000000..d9dccfea74 --- /dev/null +++ b/testTs/expect/types/stringLiteral/stringLiteralTypesAsTags01.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'hasKind'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'kind'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'kind'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/stringLiteral/stringLiteralTypesAsTags02.txt b/testTs/expect/types/stringLiteral/stringLiteralTypesAsTags02.txt new file mode 100644 index 0000000000..80dc1f55a6 --- /dev/null +++ b/testTs/expect/types/stringLiteral/stringLiteralTypesAsTags02.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'hasKind'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'kind'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'kind'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/stringLiteral/stringLiteralTypesAsTags03.txt b/testTs/expect/types/stringLiteral/stringLiteralTypesAsTags03.txt new file mode 100644 index 0000000000..80dc1f55a6 --- /dev/null +++ b/testTs/expect/types/stringLiteral/stringLiteralTypesAsTags03.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'hasKind'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'kind'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'kind'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/stringLiteral/stringLiteralTypesOverloads01.txt b/testTs/expect/types/stringLiteral/stringLiteralTypesOverloads01.txt new file mode 100644 index 0000000000..05e4467a88 --- /dev/null +++ b/testTs/expect/types/stringLiteral/stringLiteralTypesOverloads01.txt @@ -0,0 +1,2 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'getFalsyPrimitive'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 2}]} diff --git a/testTs/expect/types/stringLiteral/stringLiteralTypesOverloads02.txt b/testTs/expect/types/stringLiteral/stringLiteralTypesOverloads02.txt new file mode 100644 index 0000000000..70ce8f4aff --- /dev/null +++ b/testTs/expect/types/stringLiteral/stringLiteralTypesOverloads02.txt @@ -0,0 +1,2 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'getFalsyPrimitive'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}, {'t': 2, 'v': 2}]} diff --git a/testTs/expect/types/stringLiteral/stringLiteralTypesOverloads03.txt b/testTs/expect/types/stringLiteral/stringLiteralTypesOverloads03.txt new file mode 100644 index 0000000000..2516c69c50 --- /dev/null +++ b/testTs/expect/types/stringLiteral/stringLiteralTypesOverloads03.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/thisType/contextualThisType.txt b/testTs/expect/types/thisType/contextualThisType.txt new file mode 100644 index 0000000000..a47e1f417c --- /dev/null +++ b/testTs/expect/types/thisType/contextualThisType.txt @@ -0,0 +1,2 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/thisType/fluentInterfaces.txt b/testTs/expect/types/thisType/fluentInterfaces.txt new file mode 100644 index 0000000000..7c98a46892 --- /dev/null +++ b/testTs/expect/types/thisType/fluentInterfaces.txt @@ -0,0 +1,6 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 106}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 105}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/thisType/thisTypeAndConstraints.txt b/testTs/expect/types/thisType/thisTypeAndConstraints.txt new file mode 100644 index 0000000000..e02c6be3e5 --- /dev/null +++ b/testTs/expect/types/thisType/thisTypeAndConstraints.txt @@ -0,0 +1,9 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'self'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'self'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 107}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 106}]} diff --git a/testTs/expect/types/thisType/thisTypeInClasses.txt b/testTs/expect/types/thisType/thisTypeInClasses.txt new file mode 100644 index 0000000000..0eac1cf56f --- /dev/null +++ b/testTs/expect/types/thisType/thisTypeInClasses.txt @@ -0,0 +1,17 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 10}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 106}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'c'}, {'t': 2, 'v': 107}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'd'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'e'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'h'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'i'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'j'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 33}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 110}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 111}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 109}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 105}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 116}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 115}]} diff --git a/testTs/expect/types/thisType/thisTypeInFunctions3.txt b/testTs/expect/types/thisType/thisTypeInFunctions3.txt new file mode 100644 index 0000000000..a7c1efca5b --- /dev/null +++ b/testTs/expect/types/thisType/thisTypeInFunctions3.txt @@ -0,0 +1,5 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'm'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'check'}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'check'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'm'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} diff --git a/testTs/expect/types/thisType/thisTypeInObjectLiterals.txt b/testTs/expect/types/thisType/thisTypeInObjectLiterals.txt new file mode 100644 index 0000000000..c24a0bf467 --- /dev/null +++ b/testTs/expect/types/thisType/thisTypeInObjectLiterals.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 102}, {'t': 2, 'v': 103}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'start'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'passthrough'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'sub1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}]} diff --git a/testTs/expect/types/tuple/tupleElementTypes2.txt b/testTs/expect/types/tuple/tupleElementTypes2.txt new file mode 100644 index 0000000000..d497301857 --- /dev/null +++ b/testTs/expect/types/tuple/tupleElementTypes2.txt @@ -0,0 +1 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/tuple/tupleElementTypes4.txt b/testTs/expect/types/tuple/tupleElementTypes4.txt new file mode 100644 index 0000000000..d497301857 --- /dev/null +++ b/testTs/expect/types/tuple/tupleElementTypes4.txt @@ -0,0 +1 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/tuple/typeInferenceWithTupleType.txt b/testTs/expect/types/tuple/typeInferenceWithTupleType.txt new file mode 100644 index 0000000000..d0e34ddeda --- /dev/null +++ b/testTs/expect/types/tuple/typeInferenceWithTupleType.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'combine'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'zip'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 103}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeAliases/circularTypeAliasForUnionWithClass.txt b/testTs/expect/types/typeAliases/circularTypeAliasForUnionWithClass.txt new file mode 100644 index 0000000000..de9b5d9202 --- /dev/null +++ b/testTs/expect/types/typeAliases/circularTypeAliasForUnionWithClass.txt @@ -0,0 +1,6 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} diff --git a/testTs/expect/types/typeAliases/genericTypeAliases.txt b/testTs/expect/types/typeAliases/genericTypeAliases.txt new file mode 100644 index 0000000000..09683b3610 --- /dev/null +++ b/testTs/expect/types/typeAliases/genericTypeAliases.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'tag'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeAliases/typeAliases.txt b/testTs/expect/types/typeAliases/typeAliases.txt new file mode 100644 index 0000000000..80e2ecfef5 --- /dev/null +++ b/testTs/expect/types/typeAliases/typeAliases.txt @@ -0,0 +1,7 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeParameters/typeArgumentLists/callGenericFunctionWithZeroTypeArguments.txt b/testTs/expect/types/typeParameters/typeArgumentLists/callGenericFunctionWithZeroTypeArguments.txt new file mode 100644 index 0000000000..44ca79b97d --- /dev/null +++ b/testTs/expect/types/typeParameters/typeArgumentLists/callGenericFunctionWithZeroTypeArguments.txt @@ -0,0 +1,12 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 109}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 108}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 112}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeParameters/typeArgumentLists/constraintSatisfactionWithAny.txt b/testTs/expect/types/typeParameters/typeArgumentLists/constraintSatisfactionWithAny.txt new file mode 100644 index 0000000000..4fb3a66123 --- /dev/null +++ b/testTs/expect/types/typeParameters/typeArgumentLists/constraintSatisfactionWithAny.txt @@ -0,0 +1,12 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 111}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 110}]} diff --git a/testTs/expect/types/typeParameters/typeArgumentLists/constraintSatisfactionWithEmptyObject.txt b/testTs/expect/types/typeParameters/typeArgumentLists/constraintSatisfactionWithEmptyObject.txt new file mode 100644 index 0000000000..e6547cfa66 --- /dev/null +++ b/testTs/expect/types/typeParameters/typeArgumentLists/constraintSatisfactionWithEmptyObject.txt @@ -0,0 +1,10 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction.txt b/testTs/expect/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction.txt new file mode 100644 index 0000000000..80663a78d8 --- /dev/null +++ b/testTs/expect/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction.txt @@ -0,0 +1,15 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 108}]} diff --git a/testTs/expect/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction3.txt b/testTs/expect/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction3.txt new file mode 100644 index 0000000000..37f0a7eff4 --- /dev/null +++ b/testTs/expect/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction3.txt @@ -0,0 +1,13 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 108}]} diff --git a/testTs/expect/types/typeParameters/typeArgumentLists/instantiateGenericClassWithZeroTypeArguments.txt b/testTs/expect/types/typeParameters/typeArgumentLists/instantiateGenericClassWithZeroTypeArguments.txt new file mode 100644 index 0000000000..7160effbac --- /dev/null +++ b/testTs/expect/types/typeParameters/typeArgumentLists/instantiateGenericClassWithZeroTypeArguments.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} diff --git a/testTs/expect/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint.txt b/testTs/expect/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint.txt new file mode 100644 index 0000000000..39a6f75c07 --- /dev/null +++ b/testTs/expect/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraintTransitively.txt b/testTs/expect/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraintTransitively.txt new file mode 100644 index 0000000000..ed413477f4 --- /dev/null +++ b/testTs/expect/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraintTransitively.txt @@ -0,0 +1,5 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 101}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraintTransitively2.txt b/testTs/expect/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraintTransitively2.txt new file mode 100644 index 0000000000..ed413477f4 --- /dev/null +++ b/testTs/expect/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraintTransitively2.txt @@ -0,0 +1,5 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 101}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints.txt b/testTs/expect/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints.txt new file mode 100644 index 0000000000..6869c0a47a --- /dev/null +++ b/testTs/expect/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints.txt @@ -0,0 +1,5 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 102}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints2.txt b/testTs/expect/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints2.txt new file mode 100644 index 0000000000..26e89a1c9c --- /dev/null +++ b/testTs/expect/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints2.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} diff --git a/testTs/expect/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints3.txt b/testTs/expect/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints3.txt new file mode 100644 index 0000000000..3c518fee7b --- /dev/null +++ b/testTs/expect/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints3.txt @@ -0,0 +1,5 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 103}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} diff --git a/testTs/expect/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints3.txt b/testTs/expect/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints3.txt new file mode 100644 index 0000000000..4a2496529f --- /dev/null +++ b/testTs/expect/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints3.txt @@ -0,0 +1,12 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 108}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 109}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'g'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeParameters/typeParameterLists/typeParametersAvailableInNestedScope.txt b/testTs/expect/types/typeParameters/typeParameterLists/typeParametersAvailableInNestedScope.txt new file mode 100644 index 0000000000..f186e3e8dc --- /dev/null +++ b/testTs/expect/types/typeParameters/typeParameterLists/typeParametersAvailableInNestedScope.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'temp'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'data'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} diff --git a/testTs/expect/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType.txt b/testTs/expect/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType.txt new file mode 100644 index 0000000000..f25c3fa4f5 --- /dev/null +++ b/testTs/expect/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType.txt @@ -0,0 +1,7 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers.txt b/testTs/expect/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers.txt new file mode 100644 index 0000000000..3033ea441d --- /dev/null +++ b/testTs/expect/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers.txt @@ -0,0 +1,16 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 110}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 109}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 112}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 111}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 113}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 114}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers3.txt b/testTs/expect/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers3.txt new file mode 100644 index 0000000000..3625ce5ecc --- /dev/null +++ b/testTs/expect/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers3.txt @@ -0,0 +1,8 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 104}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 4}]} diff --git a/testTs/expect/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersNumericNames.txt b/testTs/expect/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersNumericNames.txt new file mode 100644 index 0000000000..42041b2fa3 --- /dev/null +++ b/testTs/expect/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersNumericNames.txt @@ -0,0 +1,8 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': '1'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': '1'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': '1'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': '1'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': '1.'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': '1.0'}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 4}]} diff --git a/testTs/expect/types/typeRelationships/assignmentCompatibility/everyTypeAssignableToAny.txt b/testTs/expect/types/typeRelationships/assignmentCompatibility/everyTypeAssignableToAny.txt new file mode 100644 index 0000000000..f25c3fa4f5 --- /dev/null +++ b/testTs/expect/types/typeRelationships/assignmentCompatibility/everyTypeAssignableToAny.txt @@ -0,0 +1,7 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/assignmentCompatibility/nullAssignableToEveryType.txt b/testTs/expect/types/typeRelationships/assignmentCompatibility/nullAssignableToEveryType.txt new file mode 100644 index 0000000000..f25c3fa4f5 --- /dev/null +++ b/testTs/expect/types/typeRelationships/assignmentCompatibility/nullAssignableToEveryType.txt @@ -0,0 +1,7 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/assignmentCompatibility/undefinedAssignableToEveryType.txt b/testTs/expect/types/typeRelationships/assignmentCompatibility/undefinedAssignableToEveryType.txt new file mode 100644 index 0000000000..f25c3fa4f5 --- /dev/null +++ b/testTs/expect/types/typeRelationships/assignmentCompatibility/undefinedAssignableToEveryType.txt @@ -0,0 +1,7 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/bestCommonType/arrayLiteralWithMultipleBestCommonTypes.txt b/testTs/expect/types/typeRelationships/bestCommonType/arrayLiteralWithMultipleBestCommonTypes.txt new file mode 100644 index 0000000000..fadef6f027 --- /dev/null +++ b/testTs/expect/types/typeRelationships/bestCommonType/arrayLiteralWithMultipleBestCommonTypes.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'z'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'a'}, {'t': 2, 'v': 1}]} diff --git a/testTs/expect/types/typeRelationships/comparable/equalityWithUnionTypes01.txt b/testTs/expect/types/typeRelationships/comparable/equalityWithUnionTypes01.txt new file mode 100644 index 0000000000..628107e24b --- /dev/null +++ b/testTs/expect/types/typeRelationships/comparable/equalityWithUnionTypes01.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 103}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'p2'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'p1'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/instanceOf/narrowingConstrainedTypeVariable.txt b/testTs/expect/types/typeRelationships/instanceOf/narrowingConstrainedTypeVariable.txt new file mode 100644 index 0000000000..295c5f4355 --- /dev/null +++ b/testTs/expect/types/typeRelationships/instanceOf/narrowingConstrainedTypeVariable.txt @@ -0,0 +1,15 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 103}, {'t': 2, 'v': 3}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 106}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 7}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 110}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 111}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} diff --git a/testTs/expect/types/typeRelationships/recursiveTypes/arrayLiteralsWithRecursiveGenerics.txt b/testTs/expect/types/typeRelationships/recursiveTypes/arrayLiteralsWithRecursiveGenerics.txt new file mode 100644 index 0000000000..f6310a193f --- /dev/null +++ b/testTs/expect/types/typeRelationships/recursiveTypes/arrayLiteralsWithRecursiveGenerics.txt @@ -0,0 +1,6 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'data'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'next'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'data'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'next'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} diff --git a/testTs/expect/types/typeRelationships/recursiveTypes/infiniteExpansionThroughTypeInference.txt b/testTs/expect/types/typeRelationships/recursiveTypes/infiniteExpansionThroughTypeInference.txt new file mode 100644 index 0000000000..afab9a0778 --- /dev/null +++ b/testTs/expect/types/typeRelationships/recursiveTypes/infiniteExpansionThroughTypeInference.txt @@ -0,0 +1,2 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'ff'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 3}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/recursiveTypes/recursiveTypeInGenericConstraint.txt b/testTs/expect/types/typeRelationships/recursiveTypes/recursiveTypeInGenericConstraint.txt new file mode 100644 index 0000000000..5c2a7dd624 --- /dev/null +++ b/testTs/expect/types/typeRelationships/recursiveTypes/recursiveTypeInGenericConstraint.txt @@ -0,0 +1,6 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} diff --git a/testTs/expect/types/typeRelationships/recursiveTypes/recursiveTypesUsedAsFunctionParameters.txt b/testTs/expect/types/typeRelationships/recursiveTypes/recursiveTypesUsedAsFunctionParameters.txt new file mode 100644 index 0000000000..7c366bc468 --- /dev/null +++ b/testTs/expect/types/typeRelationships/recursiveTypes/recursiveTypesUsedAsFunctionParameters.txt @@ -0,0 +1,10 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'data'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'next'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'data'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'next'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'other'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignatures3.txt b/testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignatures3.txt new file mode 100644 index 0000000000..1fa93faa9d --- /dev/null +++ b/testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignatures3.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'bing'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures3.txt b/testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures3.txt new file mode 100644 index 0000000000..1fa93faa9d --- /dev/null +++ b/testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures3.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'bing'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality.txt b/testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality.txt new file mode 100644 index 0000000000..f8e3fca87d --- /dev/null +++ b/testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'Foo'}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'Foo'}, {'t': 2, 'v': 102}]} diff --git a/testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality3.txt b/testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality3.txt new file mode 100644 index 0000000000..60fe6d0a09 --- /dev/null +++ b/testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality3.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'Foo'}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'Foo2'}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality4.txt b/testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality4.txt new file mode 100644 index 0000000000..60fe6d0a09 --- /dev/null +++ b/testTs/expect/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality4.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'Foo'}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'Foo2'}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 1}, {'t': 2, 'v': 102}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentity.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentity.txt new file mode 100644 index 0000000000..95037151dd --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentity.txt @@ -0,0 +1,24 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentity2.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentity2.txt new file mode 100644 index 0000000000..fc573f654a --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentity2.txt @@ -0,0 +1,18 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 38}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures.txt new file mode 100644 index 0000000000..f24454fda8 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures.txt @@ -0,0 +1,29 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures2.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures2.txt new file mode 100644 index 0000000000..9bc962efef --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures2.txt @@ -0,0 +1,29 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesDifferingParamCounts.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesDifferingParamCounts.txt new file mode 100644 index 0000000000..5173e9bc66 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesDifferingParamCounts.txt @@ -0,0 +1,29 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.txt new file mode 100644 index 0000000000..e705e5878c --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.txt @@ -0,0 +1,9 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesWithOverloads.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesWithOverloads.txt new file mode 100644 index 0000000000..0154d824fc --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesWithOverloads.txt @@ -0,0 +1,36 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 109}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 106}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 115}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 111}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithComplexConstraints.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithComplexConstraints.txt new file mode 100644 index 0000000000..6a70383ba0 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithComplexConstraints.txt @@ -0,0 +1 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignatures.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignatures.txt new file mode 100644 index 0000000000..a3d43467f7 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignatures.txt @@ -0,0 +1,26 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignatures2.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignatures2.txt new file mode 100644 index 0000000000..ca30cb3514 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignatures2.txt @@ -0,0 +1,21 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.txt new file mode 100644 index 0000000000..494b9b807a --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.txt @@ -0,0 +1,21 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignatures.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignatures.txt new file mode 100644 index 0000000000..2f23666400 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignatures.txt @@ -0,0 +1,29 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignatures2.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignatures2.txt new file mode 100644 index 0000000000..41ed25bc21 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignatures2.txt @@ -0,0 +1,29 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.txt new file mode 100644 index 0000000000..8dcb312db6 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.txt @@ -0,0 +1,29 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.txt new file mode 100644 index 0000000000..8115908481 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.txt @@ -0,0 +1,34 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 111}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 110}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.txt new file mode 100644 index 0000000000..b56234d2e2 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.txt @@ -0,0 +1,38 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 107}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 106}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 110}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 109}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 113}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 112}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.txt new file mode 100644 index 0000000000..2f41f6362c --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.txt @@ -0,0 +1,29 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.txt new file mode 100644 index 0000000000..2f41f6362c --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.txt @@ -0,0 +1,29 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.txt new file mode 100644 index 0000000000..2f23666400 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.txt @@ -0,0 +1,29 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.txt new file mode 100644 index 0000000000..a6e6f9303b --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.txt @@ -0,0 +1,8 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.txt new file mode 100644 index 0000000000..2f23666400 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.txt @@ -0,0 +1,29 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams.txt new file mode 100644 index 0000000000..41ed25bc21 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams.txt @@ -0,0 +1,29 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.txt new file mode 100644 index 0000000000..41ed25bc21 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.txt @@ -0,0 +1,29 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.txt new file mode 100644 index 0000000000..41ed25bc21 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.txt @@ -0,0 +1,29 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.txt new file mode 100644 index 0000000000..1d9802254d --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.txt @@ -0,0 +1,20 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.txt new file mode 100644 index 0000000000..3df781921f --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.txt @@ -0,0 +1,25 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.txt new file mode 100644 index 0000000000..00d6c0670e --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.txt @@ -0,0 +1,29 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 107}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 106}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 110}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 109}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.txt new file mode 100644 index 0000000000..54d80ef14d --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.txt @@ -0,0 +1,22 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.txt new file mode 100644 index 0000000000..3acf60e754 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.txt @@ -0,0 +1,21 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.txt new file mode 100644 index 0000000000..7ded25e220 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.txt @@ -0,0 +1,20 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 106}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.txt new file mode 100644 index 0000000000..d7f70bd647 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.txt @@ -0,0 +1,20 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.txt new file mode 100644 index 0000000000..d5f19bff46 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.txt @@ -0,0 +1,20 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.txt new file mode 100644 index 0000000000..d5f19bff46 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.txt @@ -0,0 +1,20 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.txt new file mode 100644 index 0000000000..d5f19bff46 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.txt @@ -0,0 +1,20 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithOptionality.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithOptionality.txt new file mode 100644 index 0000000000..9dd46548fa --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithOptionality.txt @@ -0,0 +1,16 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates.txt new file mode 100644 index 0000000000..25c604c8ef --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates.txt @@ -0,0 +1,32 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5d'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo15'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo16'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 105}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates2.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates2.txt new file mode 100644 index 0000000000..ae591a1f00 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates2.txt @@ -0,0 +1,9 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPublics.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPublics.txt new file mode 100644 index 0000000000..95037151dd --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPublics.txt @@ -0,0 +1,24 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo9'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo10'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo11'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo12'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo13'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo14'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/primtiveTypesAreIdentical.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/primtiveTypesAreIdentical.txt new file mode 100644 index 0000000000..d6a2cc7336 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/primtiveTypesAreIdentical.txt @@ -0,0 +1,7 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeAndMemberIdentity/typeParametersAreIdenticalToThemselves.txt b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/typeParametersAreIdenticalToThemselves.txt new file mode 100644 index 0000000000..17dd7f324c --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeAndMemberIdentity/typeParametersAreIdenticalToThemselves.txt @@ -0,0 +1,30 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'inner'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'inner2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 109}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 112}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 115}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 118}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 106}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 123}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 126}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 129}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 120}]} diff --git a/testTs/expect/types/typeRelationships/typeInference/genericCallTypeArgumentInference.txt b/testTs/expect/types/typeRelationships/typeInference/genericCallTypeArgumentInference.txt new file mode 100644 index 0000000000..1da5533049 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeInference/genericCallTypeArgumentInference.txt @@ -0,0 +1,23 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 9}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 105}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 106}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 107}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 108}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 109}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 110}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 111}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 112}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 113}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 8}, {'t': 2, 'v': 116}, {'t': 2, 'v': 117}, {'t': 2, 'v': 118}, {'t': 2, 'v': 119}, {'t': 2, 'v': 120}, {'t': 2, 'v': 121}, {'t': 2, 'v': 122}, {'t': 2, 'v': 123}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeInference/genericCallWithArrayLiteralArgs.txt b/testTs/expect/types/typeRelationships/typeInference/genericCallWithArrayLiteralArgs.txt new file mode 100644 index 0000000000..6a70383ba0 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeInference/genericCallWithArrayLiteralArgs.txt @@ -0,0 +1 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference.txt b/testTs/expect/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference.txt new file mode 100644 index 0000000000..7e684e01ec --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference.txt @@ -0,0 +1,30 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'bar'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 102}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'baz'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2b'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2c'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 9}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 112}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 113}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 114}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 115}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 116}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 117}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 118}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 119}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 120}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'constructor'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 111}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 8}, {'t': 2, 'v': 123}, {'t': 2, 'v': 124}, {'t': 2, 'v': 125}, {'t': 2, 'v': 126}, {'t': 2, 'v': 127}, {'t': 2, 'v': 128}, {'t': 2, 'v': 129}, {'t': 2, 'v': 130}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo8'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments3.txt b/testTs/expect/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments3.txt new file mode 100644 index 0000000000..ecf35319cd --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments3.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexers.txt b/testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexers.txt new file mode 100644 index 0000000000..a4b5da3f86 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexers.txt @@ -0,0 +1,4 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 33}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'other'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.txt b/testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.txt new file mode 100644 index 0000000000..0a6ef3cbcb --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.txt @@ -0,0 +1,5 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'other'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'other3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndNumericIndexer.txt b/testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndNumericIndexer.txt new file mode 100644 index 0000000000..c5f090ca63 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndNumericIndexer.txt @@ -0,0 +1,8 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 33}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'other'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'other2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'other3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndStringIndexer.txt b/testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndStringIndexer.txt new file mode 100644 index 0000000000..c5f090ca63 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndStringIndexer.txt @@ -0,0 +1,8 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 33}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'other'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'other2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'other3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments.txt b/testTs/expect/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments.txt new file mode 100644 index 0000000000..2e021cb2bc --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments.txt @@ -0,0 +1,13 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 109}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 111}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments.txt b/testTs/expect/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments.txt new file mode 100644 index 0000000000..69a0824ef9 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments.txt @@ -0,0 +1,10 @@ +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 107}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 109}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/typeRelationships/typeInference/genericClassWithObjectTypeArgsAndConstraints.txt b/testTs/expect/types/typeRelationships/typeInference/genericClassWithObjectTypeArgsAndConstraints.txt new file mode 100644 index 0000000000..4c4ee98f3b --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeInference/genericClassWithObjectTypeArgsAndConstraints.txt @@ -0,0 +1,16 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'y'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'x'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 106}, {'t': 2, 'v': 106}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 109}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 106}, {'t': 2, 'v': 106}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 108}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 112}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 106}, {'t': 2, 'v': 106}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 114}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 106}, {'t': 2, 'v': 106}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 102}]} diff --git a/testTs/expect/types/typeRelationships/typeInference/keyofInferenceLowerPriorityThanReturn.txt b/testTs/expect/types/typeRelationships/typeInference/keyofInferenceLowerPriorityThanReturn.txt new file mode 100644 index 0000000000..80a5dc606c --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeInference/keyofInferenceLowerPriorityThanReturn.txt @@ -0,0 +1,12 @@ +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'dummy'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'insertOnConflictDoNothing'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 102}, {'t': 2, 'v': 107}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'dummy'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'tableColumns'}, {'t': 2, 'v': 105}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 4}, {'t': 5, 'v': 'tableColumns'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 106}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'dummy'}, {'t': 2, 'v': 110}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 109}]} +{'lb': [{'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'dummy'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 2}, {'t': 2, 'v': 111}]} diff --git a/testTs/expect/types/typeRelationships/typeInference/unionAndIntersectionInference1.txt b/testTs/expect/types/typeRelationships/typeInference/unionAndIntersectionInference1.txt new file mode 100644 index 0000000000..cc501b03a2 --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeInference/unionAndIntersectionInference1.txt @@ -0,0 +1,11 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'i am a very certain type'}, {'t': 2, 'v': 101}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'destructure'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 103}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 101}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'isVoid'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'isNonVoid'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 105}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'foo1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 108}, {'t': 2, 'v': 3}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 3}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'baz1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 108}, {'t': 2, 'v': 3}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'get'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 111}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}]} diff --git a/testTs/expect/types/typeRelationships/typeInference/unionAndIntersectionInference2.txt b/testTs/expect/types/typeRelationships/typeInference/unionAndIntersectionInference2.txt new file mode 100644 index 0000000000..a076a5916a --- /dev/null +++ b/testTs/expect/types/typeRelationships/typeInference/unionAndIntersectionInference2.txt @@ -0,0 +1,6 @@ +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 102}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 105}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'name'}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 2}]} diff --git a/testTs/expect/types/union/contextualTypeWithUnionTypeCallSignatures.txt b/testTs/expect/types/union/contextualTypeWithUnionTypeCallSignatures.txt new file mode 100644 index 0000000000..0ba5e7a013 --- /dev/null +++ b/testTs/expect/types/union/contextualTypeWithUnionTypeCallSignatures.txt @@ -0,0 +1,9 @@ +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 102}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 103}, {'t': 2, 'v': 105}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 103}, {'t': 2, 'v': 107}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 103}, {'t': 2, 'v': 109}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/union/contextualTypeWithUnionTypeIndexSignatures.txt b/testTs/expect/types/union/contextualTypeWithUnionTypeIndexSignatures.txt new file mode 100644 index 0000000000..1a45a9bf03 --- /dev/null +++ b/testTs/expect/types/union/contextualTypeWithUnionTypeIndexSignatures.txt @@ -0,0 +1,10 @@ +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 102}, {'t': 2, 'v': 103}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'foo'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 103}, {'t': 2, 'v': 105}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 107}, {'t': 2, 'v': 108}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': '0'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 108}, {'t': 2, 'v': 110}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/union/contextualTypeWithUnionTypeMembers.txt b/testTs/expect/types/union/contextualTypeWithUnionTypeMembers.txt new file mode 100644 index 0000000000..f73b0d7093 --- /dev/null +++ b/testTs/expect/types/union/contextualTypeWithUnionTypeMembers.txt @@ -0,0 +1,14 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'commonPropertyType'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'propertyOnlyInI1'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 102}, {'t': 2, 'v': 103}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'commonMethodType'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'commonMethodWithTypeParameter'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'methodOnlyInI1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 5, 'v': 'commonPropertyType'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'propertyOnlyInI2'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 3}, {'t': 2, 'v': 106}, {'t': 2, 'v': 107}, {'t': 2, 'v': 108}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'commonMethodType'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'commonMethodWithTypeParameter'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'methodOnlyInI2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 101}, {'t': 2, 'v': 105}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'commonPropertyDifferentType'}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 111}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'commonMethodDifferentReturnType'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 5, 'v': 'commonPropertyDifferentType'}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 113}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'commonMethodDifferentReturnType'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 110}, {'t': 2, 'v': 112}]} diff --git a/testTs/expect/types/union/unionTypeCallSignatures2.txt b/testTs/expect/types/union/unionTypeCallSignatures2.txt new file mode 100644 index 0000000000..4076ace085 --- /dev/null +++ b/testTs/expect/types/union/unionTypeCallSignatures2.txt @@ -0,0 +1,6 @@ +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 102}, {'t': 2, 'v': 103}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 104}, {'t': 2, 'v': 103}, {'t': 2, 'v': 102}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 3}, {'t': 2, 'v': 103}, {'t': 2, 'v': 102}, {'t': 2, 'v': 104}]} diff --git a/testTs/expect/types/union/unionTypeCallSignatures3.txt b/testTs/expect/types/union/unionTypeCallSignatures3.txt new file mode 100644 index 0000000000..d8a1307e18 --- /dev/null +++ b/testTs/expect/types/union/unionTypeCallSignatures3.txt @@ -0,0 +1,10 @@ +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f1'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f2'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f3'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 1}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 4}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f4'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 4}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f5'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 1}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f6'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 108}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 5}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 3}, {'t': 2, 'v': 0}, {'t': 5, 'v': 'f7'}, {'t': 2, 'v': 0}, {'t': 2, 'v': 2}, {'t': 2, 'v': 4}, {'t': 2, 'v': 104}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 7}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} diff --git a/testTs/expect/types/union/unionTypeIndexSignature.txt b/testTs/expect/types/union/unionTypeIndexSignature.txt new file mode 100644 index 0000000000..2f3189f3d1 --- /dev/null +++ b/testTs/expect/types/union/unionTypeIndexSignature.txt @@ -0,0 +1,11 @@ +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 1}, {'t': 2, 'v': 33}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 103}, {'t': 2, 'v': 104}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 33}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 106}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 108}, {'t': 2, 'v': 109}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 1}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 33}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 111}, {'t': 2, 'v': 2}]} +{'lb': [{'t': 2, 'v': 6}, {'t': 2, 'v': 1}, {'t': 5, 'v': '#undefined'}, {'t': 2, 'v': 1}]} diff --git a/testTs/expect/types/union/unionTypeReduction.txt b/testTs/expect/types/union/unionTypeReduction.txt new file mode 100644 index 0000000000..b1890622b4 --- /dev/null +++ b/testTs/expect/types/union/unionTypeReduction.txt @@ -0,0 +1,3 @@ +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 8}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}, {'t': 2, 'v': 0}]} +{'lb': [{'t': 2, 'v': 4}, {'t': 2, 'v': 2}, {'t': 2, 'v': 101}, {'t': 2, 'v': 102}]} diff --git a/testTs/skip_tests.json b/testTs/skip_tests.json index 7c0018b1a7..a80afbee12 100644 --- a/testTs/skip_tests.json +++ b/testTs/skip_tests.json @@ -4156,106 +4156,37 @@ "./testTs/test/controlFlow/controlFlowInstanceOfGuardPrimitives.ts", "./testTs/test/controlFlow/controlFlowWhileStatement.ts", "./testTs/test/controlFlow/controlFlowIteration.ts", - "./testTs/test/types/import/importTypeAmbient.ts", "./testTs/test/types/never/neverUnionIntersection.ts", - "./testTs/test/types/never/neverType.ts", - "./testTs/test/types/objectTypeLiteral/objectTypeLiteralSyntax.ts", - "./testTs/test/types/objectTypeLiteral/indexSignatures/stringIndexingResults.ts", "./testTs/test/types/objectTypeLiteral/indexSignatures/numericIndexingResults.ts", - "./testTs/test/types/objectTypeLiteral/propertySignatures/propertyNameWithoutTypeAnnotation.ts", - "./testTs/test/types/objectTypeLiteral/propertySignatures/propertyNamesOfReservedWords.ts", - "./testTs/test/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloadsThatDifferOnlyByReturnType.ts", - "./testTs/test/types/objectTypeLiteral/constructSignatures/constructSignaturesWithIdenticalOverloads.ts", - "./testTs/test/types/objectTypeLiteral/constructSignatures/constructSignaturesWithOverloads.ts", - "./testTs/test/types/objectTypeLiteral/callSignatures/identicalCallSignatures.ts", - "./testTs/test/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts", "./testTs/test/types/objectTypeLiteral/callSignatures/specializedSignatureWithOptional.ts", - "./testTs/test/types/objectTypeLiteral/callSignatures/callSignatureWithoutAnnotationsOrBody.ts", "./testTs/test/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint3.ts", "./testTs/test/types/objectTypeLiteral/callSignatures/identicalCallSignatures2.ts", - "./testTs/test/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType.ts", - "./testTs/test/types/objectTypeLiteral/callSignatures/parametersWithNoAnnotationAreAny.ts", - "./testTs/test/types/objectTypeLiteral/callSignatures/stringLiteralTypesInImplementationSignatures.ts", - "./testTs/test/types/objectTypeLiteral/callSignatures/typeParameterAsTypeArgument.ts", "./testTs/test/types/objectTypeLiteral/callSignatures/identicalCallSignatures3.ts", "./testTs/test/types/objectTypeLiteral/callSignatures/callSignaturesThatDifferOnlyByReturnType3.ts", - "./testTs/test/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts", - "./testTs/test/types/objectTypeLiteral/callSignatures/specializedSignatureIsSubtypeOfNonSpecializedSignature.ts", "./testTs/test/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts", - "./testTs/test/types/objectTypeLiteral/methodSignatures/methodSignaturesWithOverloads2.ts", - "./testTs/test/types/objectTypeLiteral/methodSignatures/functionLiterals.ts", - "./testTs/test/types/literal/literalTypes2.ts", - "./testTs/test/types/literal/stringEnumLiteralTypes2.ts", - "./testTs/test/types/literal/literalTypes3.ts", - "./testTs/test/types/literal/enumLiteralTypes1.ts", - "./testTs/test/types/literal/stringEnumLiteralTypes1.ts", "./testTs/test/types/literal/literalTypesAndDestructuring.ts", - "./testTs/test/types/literal/booleanLiteralTypes1.ts", - "./testTs/test/types/literal/numericLiteralTypes2.ts", - "./testTs/test/types/literal/numericLiteralTypes1.ts", "./testTs/test/types/literal/stringLiteralsAssertionsInEqualityComparisons01.ts", "./testTs/test/types/literal/literalTypesAndTypeAssertions.ts", - "./testTs/test/types/literal/enumLiteralTypes2.ts", - "./testTs/test/types/literal/literalTypes1.ts", - "./testTs/test/types/literal/booleanLiteralTypes2.ts", "./testTs/test/types/literal/literalTypeWidening.ts", - "./testTs/test/types/specifyingTypes/typeQueries/typeofModuleWithoutExports.ts", - "./testTs/test/types/specifyingTypes/typeQueries/typeofClass2.ts", - "./testTs/test/types/specifyingTypes/typeLiterals/arrayLiteral.ts", - "./testTs/test/types/specifyingTypes/typeLiterals/functionLiteral.ts", - "./testTs/test/types/specifyingTypes/typeLiterals/parenthesizedTypes.ts", - "./testTs/test/types/specifyingTypes/typeLiterals/functionLiteralForOverloads.ts", - "./testTs/test/types/specifyingTypes/typeLiterals/functionLiteralForOverloads2.ts", "./testTs/test/types/nonPrimitive/nonPrimitiveIndexingWithForIn.ts", "./testTs/test/types/nonPrimitive/nonPrimitiveIndexingWithForInSupressError.ts", "./testTs/test/types/nonPrimitive/assignObjectToNonPrimitive.ts", - "./testTs/test/types/thisType/thisTypeInFunctions3.ts", "./testTs/test/types/thisType/thisTypeInTypePredicate.ts", "./testTs/test/types/thisType/thisTypeInInterfaces.ts", - "./testTs/test/types/thisType/contextualThisType.ts", "./testTs/test/types/thisType/thisTypeInTuples.ts", - "./testTs/test/types/thisType/thisTypeInObjectLiterals.ts", "./testTs/test/types/thisType/contextualThisTypeInJavascript.ts", - "./testTs/test/types/thisType/thisTypeInClasses.ts", - "./testTs/test/types/thisType/fluentInterfaces.ts", - "./testTs/test/types/thisType/thisTypeAndConstraints.ts", "./testTs/test/types/thisType/inferThisType.ts", "./testTs/test/types/thisType/thisTypeInBasePropertyAndDerivedContainerOfBase01.ts", - "./testTs/test/types/members/typesWithSpecializedConstructSignatures.ts", - "./testTs/test/types/members/typesWithOptionalProperty.ts", - "./testTs/test/types/members/typesWithSpecializedCallSignatures.ts", - "./testTs/test/types/members/objectTypeWithConstructSignatureHidingMembersOfFunction.ts", - "./testTs/test/types/members/classWithPublicProperty.ts", - "./testTs/test/types/members/classWithProtectedProperty.ts", - "./testTs/test/types/members/objectTypeWithCallSignatureAppearsToBeFunctionType.ts", - "./testTs/test/types/members/objectTypeWithCallSignatureHidingMembersOfFunction.ts", - "./testTs/test/types/localTypes/localTypes2.ts", - "./testTs/test/types/localTypes/localTypes3.ts", "./testTs/test/types/typeAliases/circularTypeAliasForUnionWithInterface.ts", "./testTs/test/types/typeAliases/asiPreventsParsingAsTypeAlias02.ts", "./testTs/test/types/typeAliases/asiPreventsParsingAsTypeAlias01.ts", - "./testTs/test/types/typeAliases/genericTypeAliases.ts", "./testTs/test/types/typeAliases/interfaceDoesNotDependOnBaseTypes.ts", - "./testTs/test/types/typeAliases/circularTypeAliasForUnionWithClass.ts", - "./testTs/test/types/typeAliases/typeAliases.ts", - "./testTs/test/types/mapped/isomorphicMappedTypeInference.ts", - "./testTs/test/types/mapped/mappedTypesAndObjects.ts", "./testTs/test/types/mapped/mappedTypeOverlappingStringEnumKeys.ts", - "./testTs/test/types/mapped/mappedTypeModifiers.ts", - "./testTs/test/types/mapped/mappedTypes3.ts", - "./testTs/test/types/mapped/mappedTypesArraysTuples.ts", "./testTs/test/types/mapped/mappedTypes1.ts", - "./testTs/test/types/mapped/mappedTypes2.ts", "./testTs/test/types/contextualTypes/partiallyAnnotatedFunction/partiallyAnnotatedFunctionWitoutTypeParameter.ts", - "./testTs/test/types/contextualTypes/methodDeclarations/contextuallyTypedObjectLiteralMethodDeclaration01.ts", - "./testTs/test/types/contextualTypes/methodDeclarations/contextuallyTypedBindingInitializer.ts", "./testTs/test/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes01.tsx", "./testTs/test/types/contextualTypes/logicalAnd/contextuallyTypeLogicalAnd01.ts", - "./testTs/test/types/conditional/variance.ts", "./testTs/test/types/conditional/inferTypes2.ts", - "./testTs/test/types/namedTypes/classWithOptionalParameter.ts", - "./testTs/test/types/namedTypes/genericInstantiationEquivalentToObjectLiteral.ts", - "./testTs/test/types/namedTypes/optionalMethods.ts", "./testTs/test/types/primitives/string/validStringAssignments.ts", "./testTs/test/types/primitives/string/stringPropertyAccess.ts", "./testTs/test/types/primitives/string/extendStringInterface.ts", @@ -4263,174 +4194,62 @@ "./testTs/test/types/primitives/number/numberPropertyAccess.ts", "./testTs/test/types/primitives/number/validNumberAssignments.ts", "./testTs/test/types/primitives/undefined/validUndefinedValues.ts", - "./testTs/test/types/primitives/undefined/invalidUndefinedValues.ts", "./testTs/test/types/primitives/void/validVoidAssignments.ts", "./testTs/test/types/primitives/void/validVoidValues.ts", "./testTs/test/types/primitives/boolean/extendBooleanInterface.ts", "./testTs/test/types/primitives/boolean/validBooleanAssignments.ts", "./testTs/test/types/primitives/boolean/booleanPropertyAccess.ts", "./testTs/test/types/primitives/enum/validEnumAssignments.ts", - "./testTs/test/types/union/contextualTypeWithUnionTypeCallSignatures.ts", - "./testTs/test/types/union/contextualTypeWithUnionTypeIndexSignatures.ts", - "./testTs/test/types/union/unionTypeCallSignatures2.ts", - "./testTs/test/types/union/contextualTypeWithUnionTypeMembers.ts", - "./testTs/test/types/union/unionTypeReduction.ts", - "./testTs/test/types/union/unionTypeCallSignatures3.ts", - "./testTs/test/types/union/unionTypeIndexSignature.ts", "./testTs/test/types/tuple/wideningTuples1.ts", "./testTs/test/types/tuple/tupleElementTypes1.ts", "./testTs/test/types/tuple/wideningTuples6.ts", - "./testTs/test/types/tuple/tupleElementTypes2.ts", "./testTs/test/types/tuple/wideningTuples2.ts", "./testTs/test/types/tuple/tupleElementTypes3.ts", - "./testTs/test/types/tuple/typeInferenceWithTupleType.ts", - "./testTs/test/types/tuple/tupleElementTypes4.ts", "./testTs/test/types/tuple/named/namedTupleMembers.ts", - "./testTs/test/types/keyof/keyofAndIndexedAccess.ts", "./testTs/test/types/keyof/keyofIntersection.ts", - "./testTs/test/types/any/assignEveryTypeToAny.ts", "./testTs/test/types/any/anyPropertyAccess.ts", "./testTs/test/types/any/anyAsFunctionCall.ts", "./testTs/test/types/typeParameters/recurringTypeParamForContainerOfBase01.ts", - "./testTs/test/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint.ts", - "./testTs/test/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraintTransitively2.ts", - "./testTs/test/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction.ts", - "./testTs/test/types/typeParameters/typeArgumentLists/instantiateGenericClassWithZeroTypeArguments.ts", - "./testTs/test/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints3.ts", - "./testTs/test/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints2.ts", - "./testTs/test/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints.ts", - "./testTs/test/types/typeParameters/typeArgumentLists/callGenericFunctionWithZeroTypeArguments.ts", - "./testTs/test/types/typeParameters/typeArgumentLists/constraintSatisfactionWithAny.ts", "./testTs/test/types/typeParameters/typeArgumentLists/constraintSatisfactionWithAny2.ts", - "./testTs/test/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraintTransitively.ts", - "./testTs/test/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction3.ts", - "./testTs/test/types/typeParameters/typeArgumentLists/constraintSatisfactionWithEmptyObject.ts", - "./testTs/test/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints3.ts", - "./testTs/test/types/typeParameters/typeParameterLists/typeParametersAvailableInNestedScope.ts", "./testTs/test/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints2.ts", "./testTs/test/types/spread/spreadExcessProperty.ts", - "./testTs/test/types/spread/spreadOverwritesProperty.ts", "./testTs/test/types/spread/spreadUnion4.ts", - "./testTs/test/types/spread/spreadUnion.ts", "./testTs/test/types/spread/spreadContextualTypedBindingPattern.ts", - "./testTs/test/types/spread/objectSpreadRepeatedNullCheckPerf.ts", - "./testTs/test/types/typeRelationships/recursiveTypes/recursiveTypeInGenericConstraint.ts", "./testTs/test/types/typeRelationships/recursiveTypes/nominalSubtypeCheckOfTypeParameter.ts", - "./testTs/test/types/typeRelationships/recursiveTypes/infiniteExpansionThroughTypeInference.ts", - "./testTs/test/types/typeRelationships/recursiveTypes/arrayLiteralsWithRecursiveGenerics.ts", - "./testTs/test/types/typeRelationships/recursiveTypes/recursiveTypesUsedAsFunctionParameters.ts", "./testTs/test/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation2.ts", "./testTs/test/types/typeRelationships/recursiveTypes/nominalSubtypeCheckOfTypeParameter2.ts", "./testTs/test/types/typeRelationships/widenedTypes/strictNullChecksNoWidening.ts", "./testTs/test/types/typeRelationships/widenedTypes/objectLiteralWidened.ts", "./testTs/test/types/typeRelationships/widenedTypes/initializersWidened.ts", "./testTs/test/types/typeRelationships/widenedTypes/arrayLiteralWidened.ts", - "./testTs/test/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality3.ts", "./testTs/test/types/typeRelationships/subtypesAndSuperTypes/nullIsSubtypeOfEverythingButUndefined.ts", "./testTs/test/types/typeRelationships/subtypesAndSuperTypes/undefinedIsSubtypeOfEverything.ts", "./testTs/test/types/typeRelationships/subtypesAndSuperTypes/subtypesOfAny.ts", "./testTs/test/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures.ts", "./testTs/test/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignatures.ts", "./testTs/test/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints2.ts", - "./testTs/test/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality.ts", - "./testTs/test/types/typeRelationships/subtypesAndSuperTypes/subtypingWithConstructSignatures3.ts", - "./testTs/test/types/typeRelationships/subtypesAndSuperTypes/subtypingWithCallSignatures3.ts", - "./testTs/test/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembersOptionality4.ts", "./testTs/test/types/typeRelationships/comparable/optionalProperties01.ts", "./testTs/test/types/typeRelationships/comparable/switchCaseWithIntersectionTypes01.ts", "./testTs/test/types/typeRelationships/comparable/independentPropertyVariance.ts", - "./testTs/test/types/typeRelationships/comparable/equalityWithUnionTypes01.ts", "./testTs/test/types/typeRelationships/comparable/optionalProperties02.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates2.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignatures.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignatures.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentity.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithComplexConstraints.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures2.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesDifferingParamCounts.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesWithOverloads.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithOptionality.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentity2.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPublics.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignatures2.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/typeParametersAreIdenticalToThemselves.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithPrivates.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/primtiveTypesAreIdentical.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignatures2.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesOptionalParams.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithCallSignatures.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.ts", - "./testTs/test/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts", - "./testTs/test/types/typeRelationships/bestCommonType/arrayLiteralWithMultipleBestCommonTypes.ts", "./testTs/test/types/typeRelationships/bestCommonType/heterogeneousArrayLiterals.ts", - "./testTs/test/types/typeRelationships/instanceOf/narrowingConstrainedTypeVariable.ts", - "./testTs/test/types/typeRelationships/typeInference/unionAndIntersectionInference2.ts", - "./testTs/test/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments.ts", - "./testTs/test/types/typeRelationships/typeInference/genericCallTypeArgumentInference.ts", "./testTs/test/types/typeRelationships/typeInference/genericContextualTypes1.ts", "./testTs/test/types/typeRelationships/typeInference/genericFunctionParameters.ts", - "./testTs/test/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts", - "./testTs/test/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexers.ts", - "./testTs/test/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndNumericIndexer.ts", - "./testTs/test/types/typeRelationships/typeInference/genericCallWithArrayLiteralArgs.ts", - "./testTs/test/types/typeRelationships/typeInference/genericClassWithObjectTypeArgsAndConstraints.ts", - "./testTs/test/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference.ts", - "./testTs/test/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments3.ts", - "./testTs/test/types/typeRelationships/typeInference/keyofInferenceLowerPriorityThanReturn.ts", - "./testTs/test/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndStringIndexer.ts", "./testTs/test/types/typeRelationships/typeInference/keyofInferenceIntersectsResults.ts", - "./testTs/test/types/typeRelationships/typeInference/unionAndIntersectionInference1.ts", - "./testTs/test/types/typeRelationships/typeInference/genericCallWithOverloadedConstructorTypedArguments.ts", "./testTs/test/types/typeRelationships/typeInference/bivariantInferences.ts", "./testTs/test/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints.ts", "./testTs/test/types/typeRelationships/typeInference/discriminatedUnionInference.ts", - "./testTs/test/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType.ts", - "./testTs/test/types/typeRelationships/assignmentCompatibility/nullAssignableToEveryType.ts", "./testTs/test/types/typeRelationships/assignmentCompatibility/numberAssignableToEnum.ts", - "./testTs/test/types/typeRelationships/assignmentCompatibility/undefinedAssignableToEveryType.ts", "./testTs/test/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures3.ts", "./testTs/test/types/typeRelationships/assignmentCompatibility/anyAssignabilityInInheritance.ts", - "./testTs/test/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers3.ts", - "./testTs/test/types/typeRelationships/assignmentCompatibility/everyTypeAssignableToAny.ts", "./testTs/test/types/typeRelationships/assignmentCompatibility/assignmentCompatWithWithGenericConstructSignatures.ts", "./testTs/test/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType2.ts", - "./testTs/test/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers.ts", "./testTs/test/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures.ts", - "./testTs/test/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersNumericNames.ts", - "./testTs/test/types/stringLiteral/stringLiteralTypesOverloads03.ts", "./testTs/test/types/stringLiteral/stringLiteralTypesOverloads04.ts", "./testTs/test/types/stringLiteral/stringLiteralTypesInUnionTypes04.ts", "./testTs/test/types/stringLiteral/stringLiteralTypeAssertion01.ts", - "./testTs/test/types/stringLiteral/stringLiteralTypesAsTags03.ts", - "./testTs/test/types/stringLiteral/stringLiteralTypesAsTags02.ts", - "./testTs/test/types/stringLiteral/stringLiteralTypesAsTags01.ts", - "./testTs/test/types/stringLiteral/stringLiteralTypesAndTuples01.ts", "./testTs/test/types/stringLiteral/stringLiteralMatchedInSwitch01.ts", - "./testTs/test/types/stringLiteral/stringLiteralTypesOverloads01.ts", - "./testTs/test/types/stringLiteral/stringLiteralTypesAndParenthesizedExpressions01.ts", - "./testTs/test/types/stringLiteral/stringLiteralTypesOverloads02.ts", "./testTs/test/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts", - "./testTs/test/types/intersection/operatorsAndIntersectionTypes.ts", "./testTs/test/types/intersection/intersectionTypeMembers.ts", "./testTs/test/types/intersection/intersectionOfUnionNarrowing.ts", "./testTs/test/types/intersection/intersectionTypeInference2.ts", @@ -4439,15 +4258,10 @@ "./testTs/test/types/intersection/intersectionTypeEquivalence.ts", "./testTs/test/types/intersection/intersectionTypeInference3.ts", "./testTs/test/types/intersection/contextualIntersectionType.ts", - "./testTs/test/types/intersection/intersectionThisTypes.ts", "./testTs/test/types/intersection/intersectionOfUnionOfUnitTypes.ts", "./testTs/test/types/rest/genericRestParameters2.ts", - "./testTs/test/types/rest/objectRestParameter.ts", - "./testTs/test/types/rest/objectRestForOf.ts", "./testTs/test/types/rest/objectRestCatchES5.ts", "./testTs/test/types/rest/objectRestReadonly.ts", - "./testTs/test/types/rest/objectRestAssignment.ts", - "./testTs/test/types/rest/objectRest2.ts", "./testTs/test/internalModules/codeGeneration/nameCollision.ts", "./testTs/test/internalModules/codeGeneration/importStatements.ts", "./testTs/test/internalModules/codeGeneration/exportCodeGen.ts", -- Gitee From e4d928925c898e7afc5e09a10b0f096b43b9650e Mon Sep 17 00:00:00 2001 From: jiangkaiwen Date: Wed, 21 Sep 2022 17:00:06 +0800 Subject: [PATCH 17/28] Fix codecheck warnings of the 0913 branch 1. Override modifies virtual functions 2. The function declaration is consistent with the defined parameters 3. Single parameter constructors are declared explicit Issue:I5S8D8 Signed-off-by: jiangkaiwen Change-Id: If3ee58975f9c28045cc8603d72a7939bad857b40 --- es2panda/compiler/core/compileQueue.h | 10 +++++----- es2panda/es2panda.h | 2 +- es2panda/parser/parserImpl.h | 2 +- es2panda/util/symbolTable.h | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/es2panda/compiler/core/compileQueue.h b/es2panda/compiler/core/compileQueue.h index 17392fe4a0..fe1f0da290 100644 --- a/es2panda/compiler/core/compileQueue.h +++ b/es2panda/compiler/core/compileQueue.h @@ -55,7 +55,7 @@ public: explicit CompileFunctionJob(CompilerContext *context) : context_(context) {}; NO_COPY_SEMANTIC(CompileFunctionJob); NO_MOVE_SEMANTIC(CompileFunctionJob); - ~CompileFunctionJob() = default; + ~CompileFunctionJob() override = default; binder::FunctionScope *Scope() const { @@ -79,7 +79,7 @@ public: explicit CompileModuleRecordJob(CompilerContext *context) : context_(context) {}; NO_COPY_SEMANTIC(CompileModuleRecordJob); NO_MOVE_SEMANTIC(CompileModuleRecordJob); - ~CompileModuleRecordJob() = default; + ~CompileModuleRecordJob() override = default; void Run() override; @@ -95,7 +95,7 @@ public: : src_(src), options_(options), progsInfo_(progsInfo), symbolTable_(symbolTable), allocator_(allocator) {}; NO_COPY_SEMANTIC(CompileFileJob); NO_MOVE_SEMANTIC(CompileFileJob); - ~CompileFileJob() = default; + ~CompileFileJob() override = default; void Run() override; @@ -140,7 +140,7 @@ public: NO_COPY_SEMANTIC(CompileFuncQueue); NO_MOVE_SEMANTIC(CompileFuncQueue); - ~CompileFuncQueue() = default; + ~CompileFuncQueue() override = default; void Schedule() override; @@ -158,7 +158,7 @@ public: NO_COPY_SEMANTIC(CompileFileQueue); NO_MOVE_SEMANTIC(CompileFileQueue); - ~CompileFileQueue() = default; + ~CompileFileQueue() override = default; void Schedule() override; diff --git a/es2panda/es2panda.h b/es2panda/es2panda.h index ef72517fc3..70e5524b77 100644 --- a/es2panda/es2panda.h +++ b/es2panda/es2panda.h @@ -165,7 +165,7 @@ public: panda::pandasm::Program *Compile(const SourceFile &input, const CompilerOptions &options, util::SymbolTable *symbolTable = nullptr); - panda::pandasm::Program *CompileFile(CompilerOptions &options, SourceFile *src, util::SymbolTable *symbolTable_); + panda::pandasm::Program *CompileFile(CompilerOptions &options, SourceFile *src, util::SymbolTable *symbolTable); static int CompileFiles(CompilerOptions &options, std::map *cacheProgs, diff --git a/es2panda/parser/parserImpl.h b/es2panda/parser/parserImpl.h index 974a6a0baa..ff4a6e6653 100644 --- a/es2panda/parser/parserImpl.h +++ b/es2panda/parser/parserImpl.h @@ -282,7 +282,7 @@ private: ir::Statement *ParseClassProperty(ClassElmentDescriptor *desc, const ArenaVector &properties, ir::Expression *propName, ir::Expression *typeAnnotation, ArenaVector &&decorators, bool isDeclare); - void ParseClassKeyModifiers(ClassElmentDescriptor *descy); + void ParseClassKeyModifiers(ClassElmentDescriptor *desc); void CheckClassGeneratorMethod(ClassElmentDescriptor *desc); void CheckClassPrivateIdentifier(ClassElmentDescriptor *desc); ir::Expression *ParseClassKeyAnnotation(); diff --git a/es2panda/util/symbolTable.h b/es2panda/util/symbolTable.h index 518a1c7142..892a31ad4e 100644 --- a/es2panda/util/symbolTable.h +++ b/es2panda/util/symbolTable.h @@ -33,8 +33,8 @@ public: ArenaMap> lexenv; // lexenv: > ArenaMap classHash; - OriginFunctionInfo(ArenaAllocator *allocator) : lexenv(allocator->Adapter()), - classHash(allocator->Adapter()) {} + explicit OriginFunctionInfo(ArenaAllocator *allocator) : lexenv(allocator->Adapter()), + classHash(allocator->Adapter()) {} }; SymbolTable(const std::string &inputSymbolTable, const std::string &dumpSymbolTable) -- Gitee From 0bc015418bab0d46bd875e3608a19e62c9d618fe Mon Sep 17 00:00:00 2001 From: jiangkaiwen Date: Fri, 23 Sep 2022 12:47:44 +0800 Subject: [PATCH 18/28] Fix codecheck warnings of the master branch 1. The length of one line of code shall not exceed 120 characters 2. Header file comments Issue:I5SPU9 Signed-off-by: jiangkaiwen Change-Id: I90211b725e30c4a8e2a657e25a13e339abaf6721 --- es2panda/typescript/core/helpers.cpp | 2 +- es2panda/util/base64.h | 2 +- es2panda/util/bitset.h | 2 +- es2panda/util/enumbitops.h | 2 +- es2panda/util/helpers.cpp | 2 +- es2panda/util/helpers.h | 2 +- es2panda/util/hotfix.cpp | 5 +++-- es2panda/util/hotfix.h | 2 +- es2panda/util/moduleHelpers.cpp | 2 +- es2panda/util/moduleHelpers.h | 2 +- es2panda/util/programCache.h | 2 +- es2panda/util/symbolTable.cpp | 2 +- es2panda/util/symbolTable.h | 2 +- es2panda/util/ustring.h | 2 +- test262/run_sunspider.py | 3 ++- test262/utils.py | 3 ++- 16 files changed, 20 insertions(+), 17 deletions(-) diff --git a/es2panda/typescript/core/helpers.cpp b/es2panda/typescript/core/helpers.cpp index b09b499e85..18a876b0a4 100644 --- a/es2panda/typescript/core/helpers.cpp +++ b/es2panda/typescript/core/helpers.cpp @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/es2panda/util/base64.h b/es2panda/util/base64.h index 239a6dff9e..400d5d9946 100644 --- a/es2panda/util/base64.h +++ b/es2panda/util/base64.h @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/es2panda/util/bitset.h b/es2panda/util/bitset.h index ad621e04c8..433f9a404e 100644 --- a/es2panda/util/bitset.h +++ b/es2panda/util/bitset.h @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/es2panda/util/enumbitops.h b/es2panda/util/enumbitops.h index f42426cda4..73fb3eda22 100644 --- a/es2panda/util/enumbitops.h +++ b/es2panda/util/enumbitops.h @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/es2panda/util/helpers.cpp b/es2panda/util/helpers.cpp index 10c598c476..afe9ed62ab 100644 --- a/es2panda/util/helpers.cpp +++ b/es2panda/util/helpers.cpp @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/es2panda/util/helpers.h b/es2panda/util/helpers.h index d9021aa9e2..77c8b069e0 100644 --- a/es2panda/util/helpers.h +++ b/es2panda/util/helpers.h @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/es2panda/util/hotfix.cpp b/es2panda/util/hotfix.cpp index 1994170652..0c50e58422 100644 --- a/es2panda/util/hotfix.cpp +++ b/es2panda/util/hotfix.cpp @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -432,7 +432,8 @@ void Hotfix::HandleFunction(const compiler::PandaGen *pg, panda::pandasm::Functi auto originFunction = originFunctionInfo_->find(funcName); if (originFunction == originFunctionInfo_->end()) { if (IsAnonymousOrDuplicateNameFunction(funcName)) { - std::cerr << "Found new anonymous or duplicate name function " << funcName << " not supported!" << std::endl; + std::cerr << "Found new anonymous or duplicate name function " << funcName + << " not supported!" << std::endl; patchError_ = true; return; } diff --git a/es2panda/util/hotfix.h b/es2panda/util/hotfix.h index 53bf7a043e..004d98b10c 100644 --- a/es2panda/util/hotfix.h +++ b/es2panda/util/hotfix.h @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/es2panda/util/moduleHelpers.cpp b/es2panda/util/moduleHelpers.cpp index 53841408ee..69174c9e67 100644 --- a/es2panda/util/moduleHelpers.cpp +++ b/es2panda/util/moduleHelpers.cpp @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/es2panda/util/moduleHelpers.h b/es2panda/util/moduleHelpers.h index 3c0a68e918..f7952e705d 100644 --- a/es2panda/util/moduleHelpers.h +++ b/es2panda/util/moduleHelpers.h @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/es2panda/util/programCache.h b/es2panda/util/programCache.h index f0512342e2..24f71ae7d6 100644 --- a/es2panda/util/programCache.h +++ b/es2panda/util/programCache.h @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/es2panda/util/symbolTable.cpp b/es2panda/util/symbolTable.cpp index 000f1a9c19..2b31ca0c8b 100644 --- a/es2panda/util/symbolTable.cpp +++ b/es2panda/util/symbolTable.cpp @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/es2panda/util/symbolTable.h b/es2panda/util/symbolTable.h index 892a31ad4e..884ad13177 100644 --- a/es2panda/util/symbolTable.h +++ b/es2panda/util/symbolTable.h @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/es2panda/util/ustring.h b/es2panda/util/ustring.h index 4114601087..b984080037 100644 --- a/es2panda/util/ustring.h +++ b/es2panda/util/ustring.h @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test262/run_sunspider.py b/test262/run_sunspider.py index f7f6ea757a..0a06caa4bd 100755 --- a/test262/run_sunspider.py +++ b/test262/run_sunspider.py @@ -254,7 +254,8 @@ class ArkProgram(): # pre-generate the dependencies' abc when ark_frontend is [es2panda] if (file_name in self.module_list or file_name in self.dynamicImport_list) and \ self.ark_frontend == ARK_FRONTEND_LIST[1]: - search_dir = "language/module-code" if file_name in self.module_list else "language/expressions/dynamic-import" + search_dir = "language/module-code" if file_name in self.module_list \ + else "language/expressions/dynamic-import" dependencies = collect_module_dependencies(js_file, os.path.join(TEST_FULL_DIR, search_dir), []) for dependency in list(set(dependencies)): self.gen_dependency_abc(dependency) diff --git a/test262/utils.py b/test262/utils.py index 6fba9bbf9c..6d38ded768 100755 --- a/test262/utils.py +++ b/test262/utils.py @@ -179,7 +179,8 @@ def collect_module_dependencies(file, directory, traversedDependencies): if re.search(r'\S+_FIXTURE.js$', specifier): dependency = search_dependency(specifier.lstrip('./'), directory) if dependency not in traversedDependencies: - dependencies.extend(collect_module_dependencies(dependency, directory, list(set(traversedDependencies)))) + dependencies.extend(collect_module_dependencies(dependency, directory, + list(set(traversedDependencies)))) dependencies.append(dependency) return dependencies -- Gitee From 848aed1e8489a18e36e6c3feb22d6872db8d2af2 Mon Sep 17 00:00:00 2001 From: gavin1012_hw Date: Tue, 20 Sep 2022 16:26:51 +0800 Subject: [PATCH 19/28] Support optional chain Signed-off-by: gavin1012_hw Change-Id: If4dc7be54206fe06eba7bf414383ef4c33793509 --- es2panda/BUILD.gn | 1 + es2panda/compiler/base/optionalChain.cpp | 62 ++++++++++ es2panda/compiler/base/optionalChain.h | 44 +++++++ es2panda/compiler/core/pandagen.h | 8 ++ es2panda/ir/expressions/callExpression.cpp | 5 + es2panda/ir/expressions/chainExpression.cpp | 38 ++---- es2panda/ir/expressions/memberExpression.cpp | 10 +- test262/es2021_tests.txt | 118 ++++++++++++------- test262/skip_tests.json | 9 +- 9 files changed, 215 insertions(+), 80 deletions(-) create mode 100644 es2panda/compiler/base/optionalChain.cpp create mode 100644 es2panda/compiler/base/optionalChain.h diff --git a/es2panda/BUILD.gn b/es2panda/BUILD.gn index 847457188e..cf0198dc70 100644 --- a/es2panda/BUILD.gn +++ b/es2panda/BUILD.gn @@ -29,6 +29,7 @@ es2panda_src = [ "compiler/base/lexenv.cpp", "compiler/base/literals.cpp", "compiler/base/lreference.cpp", + "compiler/base/optionalChain.cpp", "compiler/core/compileQueue.cpp", "compiler/core/compilerContext.cpp", "compiler/core/compilerImpl.cpp", diff --git a/es2panda/compiler/base/optionalChain.cpp b/es2panda/compiler/base/optionalChain.cpp new file mode 100644 index 0000000000..af6ec45f5f --- /dev/null +++ b/es2panda/compiler/base/optionalChain.cpp @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "optionalChain.h" + +#include + +namespace panda::es2panda::compiler { +OptionalChain::OptionalChain(PandaGen *pg, const ir::AstNode *node) : pg_(pg), node_(node), prev_(pg->optionalChain_) +{ + pg_->optionalChain_ = this; +} + +OptionalChain::~OptionalChain() +{ + if (label_) { + pg_->SetLabel(node_, label_); + } + pg_->optionalChain_ = prev_; +} + +void OptionalChain::CheckNullish(bool optional, compiler::VReg obj) +{ + if (!optional) { + return; + } + + if (!label_) { + label_ = pg_->AllocLabel(); + } + + RegScope rs(pg_); + + auto *notNullish = pg_->AllocLabel(); + auto *nullish = pg_->AllocLabel(); + + pg_->LoadConst(node_, Constant::JS_NULL); + pg_->Condition(node_, lexer::TokenType::PUNCTUATOR_NOT_STRICT_EQUAL, obj, nullish); + pg_->LoadConst(node_, Constant::JS_UNDEFINED); + pg_->Condition(node_, lexer::TokenType::PUNCTUATOR_NOT_STRICT_EQUAL, obj, nullish); + pg_->Branch(node_, notNullish); + pg_->SetLabel(node_, nullish); + + pg_->LoadConst(node_, compiler::Constant::JS_UNDEFINED); + pg_->Branch(node_, label_); + pg_->SetLabel(node_, notNullish); + pg_->LoadAccumulator(node_, obj); +} + +} // namespace panda::es2panda::compiler diff --git a/es2panda/compiler/base/optionalChain.h b/es2panda/compiler/base/optionalChain.h new file mode 100644 index 0000000000..c6005d03b2 --- /dev/null +++ b/es2panda/compiler/base/optionalChain.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ES2PANDA_COMPILER_BASE_OPTIONAL_CHAIN_H +#define ES2PANDA_COMPILER_BASE_OPTIONAL_CHAIN_H + +#include +#include + +namespace panda::es2panda::compiler { +class PandaGen; +class Label; + +class OptionalChain { +public: + explicit OptionalChain(PandaGen *pg, const ir::AstNode *node); + ~OptionalChain(); + + void CheckNullish(bool optional, compiler::VReg obj); + + NO_COPY_SEMANTIC(OptionalChain); + NO_MOVE_SEMANTIC(OptionalChain); + +private: + PandaGen *pg_ {}; + const ir::AstNode *node_ {}; + Label *label_ {}; + OptionalChain *prev_ {}; +}; +} // namespace panda::es2panda::compiler + +#endif diff --git a/es2panda/compiler/core/pandagen.h b/es2panda/compiler/core/pandagen.h index 64fe2d6132..79b68804e4 100644 --- a/es2panda/compiler/core/pandagen.h +++ b/es2panda/compiler/core/pandagen.h @@ -16,6 +16,7 @@ #ifndef ES2PANDA_COMPILER_CORE_PANDAGEN_H #define ES2PANDA_COMPILER_CORE_PANDAGEN_H +#include #include #include #include @@ -174,6 +175,11 @@ public: return buffStorage_; } + OptionalChain *GetOptionalChain() const + { + return optionalChain_; + } + uint32_t IcSize() const { return ic_.Size(); @@ -430,6 +436,7 @@ private: ArenaVector buffStorage_; EnvScope *envScope_ {}; DynamicContext *dynamicContext_ {}; + OptionalChain *optionalChain_ {}; InlineCache ic_; SimpleAllocator sa_; RegAllocator ra_; @@ -446,6 +453,7 @@ private: friend class EnvScope; friend class LoopEnvScope; friend class DynamicContext; + friend class OptionalChain; size_t labelId_ {0}; }; } // namespace panda::es2panda::compiler diff --git a/es2panda/ir/expressions/callExpression.cpp b/es2panda/ir/expressions/callExpression.cpp index dc09961b5d..c829b559a4 100644 --- a/es2panda/ir/expressions/callExpression.cpp +++ b/es2panda/ir/expressions/callExpression.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -119,11 +120,15 @@ void CallExpression::Compile(compiler::PandaGen *pg) const compiler::RegScope mrs(pg); callee_->AsMemberExpression()->Compile(pg, thisReg); + } else if (callee_->IsChainExpression()) { + hasThis = true; + callee_->AsChainExpression()->Compile(pg); } else { callee_->Compile(pg); } pg->StoreAccumulator(this, callee); + pg->GetOptionalChain()->CheckNullish(optional_, callee); if (containsSpread) { if (!hasThis) { diff --git a/es2panda/ir/expressions/chainExpression.cpp b/es2panda/ir/expressions/chainExpression.cpp index 3bf58ae577..495cb42bea 100644 --- a/es2panda/ir/expressions/chainExpression.cpp +++ b/es2panda/ir/expressions/chainExpression.cpp @@ -14,11 +14,12 @@ */ #include "chainExpression.h" -#include +#include +#include #include -#include #include +#include namespace panda::es2panda::ir { @@ -34,35 +35,14 @@ void ChainExpression::Dump(ir::AstDumper *dumper) const void ChainExpression::Compile(compiler::PandaGen *pg) const { - // TODO: support continuous optional chain expression - compiler::RegScope rs(pg); - const MemberExpression *memberExpr = nullptr; - if (this->GetExpression()->IsMemberExpression()) { - memberExpr = this->GetExpression()->AsMemberExpression(); + compiler::OptionalChain chain(pg, this); + + if (expression_->IsMemberExpression()) { + expression_->AsMemberExpression()->Compile(pg); } else { - auto callExpr = this->GetExpression()->AsCallExpression(); - memberExpr = callExpr->Callee()->AsMemberExpression(); + assert(expression_->IsCallExpression()); + expression_->AsCallExpression()->Compile(pg); } - - compiler::VReg objReg = pg->AllocReg(); - auto *isNullOrUndefinedLabel = pg->AllocLabel(); - auto *endLabel = pg->AllocLabel(); - - memberExpr->CompileObject(pg, objReg); - pg->LoadConst(this, compiler::Constant::JS_NULL); - pg->Condition(this, lexer::TokenType::PUNCTUATOR_NOT_STRICT_EQUAL, objReg, isNullOrUndefinedLabel); - pg->LoadConst(this, compiler::Constant::JS_UNDEFINED); - pg->Condition(this, lexer::TokenType::PUNCTUATOR_NOT_STRICT_EQUAL, objReg, isNullOrUndefinedLabel); - - // obj (ahead ?.) is not null/undefined, continue to compile sub-expression) - this->GetExpression()->Compile(pg); - pg->Branch(this, endLabel); - - // obj (ahead ?.) is null/undefined, return undefined) - pg->SetLabel(this, isNullOrUndefinedLabel); - pg->LoadConst(this, compiler::Constant::JS_UNDEFINED); - - pg->SetLabel(this, endLabel); } checker::Type *ChainExpression::Check(checker::Checker *checker) const diff --git a/es2panda/ir/expressions/memberExpression.cpp b/es2panda/ir/expressions/memberExpression.cpp index db2fcb5136..6754ecf672 100644 --- a/es2panda/ir/expressions/memberExpression.cpp +++ b/es2panda/ir/expressions/memberExpression.cpp @@ -43,6 +43,7 @@ void MemberExpression::CompileObject(compiler::PandaGen *pg, compiler::VReg dest { object_->Compile(pg); pg->StoreAccumulator(this, dest); + pg->GetOptionalChain()->CheckNullish(optional_, dest); } compiler::Operand MemberExpression::CompileKey(compiler::PandaGen *pg) const @@ -54,14 +55,7 @@ void MemberExpression::Compile(compiler::PandaGen *pg) const { compiler::RegScope rs(pg); compiler::VReg objReg = pg->AllocReg(); - CompileObject(pg, objReg); - compiler::Operand prop = CompileKey(pg); - - if (object_->IsSuperExpression()) { - pg->LoadSuperProperty(this, objReg, prop); - } else { - pg->LoadObjProperty(this, objReg, prop); - } + Compile(pg, objReg); } void MemberExpression::Compile(compiler::PandaGen *pg, compiler::VReg objReg) const diff --git a/test262/es2021_tests.txt b/test262/es2021_tests.txt index a0ea2db1ec..f4e31babb9 100644 --- a/test262/es2021_tests.txt +++ b/test262/es2021_tests.txt @@ -1,3 +1,43 @@ +built-ins/AsyncGeneratorFunction/name.js +built-ins/AsyncGeneratorFunction/length.js +built-ins/AsyncGeneratorFunction/prototype/constructor.js +built-ins/AsyncGeneratorFunction/prototype/prop-desc.js +built-ins/AsyncGeneratorFunction/prototype/Symbol.toStringTag.js +built-ins/AsyncGeneratorFunction/prototype/not-callable.js +built-ins/AsyncGeneratorFunction/prototype/prototype.js +built-ins/AsyncGeneratorFunction/prototype/extensibility.js +built-ins/AsyncGeneratorFunction/extensibility.js +built-ins/AsyncGeneratorPrototype/Symbol.toStringTag.js +built-ins/AsyncGeneratorPrototype/throw/return-rejected-promise.js +built-ins/AsyncGeneratorPrototype/throw/throw-suspendedStart-promise.js +built-ins/AsyncGeneratorPrototype/throw/throw-suspendedYield-try-finally-return.js +built-ins/AsyncGeneratorPrototype/throw/throw-suspendedYield-try-finally-throw.js +built-ins/AsyncGeneratorPrototype/throw/prop-desc.js +built-ins/AsyncGeneratorPrototype/throw/throw-suspendedYield-promise.js +built-ins/AsyncGeneratorPrototype/throw/throw-state-completed.js +built-ins/AsyncGeneratorPrototype/throw/throw-suspendedStart.js +built-ins/AsyncGeneratorPrototype/throw/throw-suspendedYield-try-catch.js +built-ins/AsyncGeneratorPrototype/throw/name.js +built-ins/AsyncGeneratorPrototype/throw/length.js +built-ins/AsyncGeneratorPrototype/throw/throw-suspendedYield.js +built-ins/AsyncGeneratorPrototype/next/request-queue-promise-resolve-order.js +built-ins/AsyncGeneratorPrototype/next/request-queue-order.js +built-ins/AsyncGeneratorPrototype/next/prop-desc.js +built-ins/AsyncGeneratorPrototype/next/iterator-result-prototype.js +built-ins/AsyncGeneratorPrototype/next/name.js +built-ins/AsyncGeneratorPrototype/next/length.js +built-ins/AsyncGeneratorPrototype/next/request-queue-await-order.js +built-ins/AsyncGeneratorPrototype/next/return-promise.js +built-ins/AsyncGeneratorPrototype/return/return-suspendedStart.js +built-ins/AsyncGeneratorPrototype/return/prop-desc.js +built-ins/AsyncGeneratorPrototype/return/return-suspendedYield.js +built-ins/AsyncGeneratorPrototype/return/iterator-result-prototype.js +built-ins/AsyncGeneratorPrototype/return/name.js +built-ins/AsyncGeneratorPrototype/return/return-state-completed.js +built-ins/AsyncGeneratorPrototype/return/length.js +built-ins/AsyncGeneratorPrototype/return/return-suspendedStart-promise.js +built-ins/AsyncGeneratorPrototype/return/return-promise.js +built-ins/AsyncGeneratorPrototype/return/return-suspendedYield-promise.js built-ins/String/prototype/matchAll/regexp-get-matchAll-throws.js built-ins/String/prototype/matchAll/not-a-constructor.js built-ins/String/prototype/matchAll/flags-undefined-throws.js @@ -656,43 +696,41 @@ language/expressions/dynamic-import/for-await-resolution-and-error-a_FIXTURE.js language/expressions/dynamic-import/module-code_FIXTURE.js language/expressions/dynamic-import/update-to-dynamic-import-other_FIXTURE.js language/expressions/dynamic-import/syntax/valid/empty_FIXTURE.js -built-ins/AsyncGeneratorFunction/name.js -built-ins/AsyncGeneratorFunction/length.js -built-ins/AsyncGeneratorFunction/prototype/constructor.js -built-ins/AsyncGeneratorFunction/prototype/prop-desc.js -built-ins/AsyncGeneratorFunction/prototype/Symbol.toStringTag.js -built-ins/AsyncGeneratorFunction/prototype/not-callable.js -built-ins/AsyncGeneratorFunction/prototype/prototype.js -built-ins/AsyncGeneratorFunction/prototype/extensibility.js -built-ins/AsyncGeneratorFunction/extensibility.js -built-ins/AsyncGeneratorPrototype/Symbol.toStringTag.js -built-ins/AsyncGeneratorPrototype/throw/return-rejected-promise.js -built-ins/AsyncGeneratorPrototype/throw/throw-suspendedStart-promise.js -built-ins/AsyncGeneratorPrototype/throw/throw-suspendedYield-try-finally-return.js -built-ins/AsyncGeneratorPrototype/throw/throw-suspendedYield-try-finally-throw.js -built-ins/AsyncGeneratorPrototype/throw/prop-desc.js -built-ins/AsyncGeneratorPrototype/throw/throw-suspendedYield-promise.js -built-ins/AsyncGeneratorPrototype/throw/throw-state-completed.js -built-ins/AsyncGeneratorPrototype/throw/throw-suspendedStart.js -built-ins/AsyncGeneratorPrototype/throw/throw-suspendedYield-try-catch.js -built-ins/AsyncGeneratorPrototype/throw/name.js -built-ins/AsyncGeneratorPrototype/throw/length.js -built-ins/AsyncGeneratorPrototype/throw/throw-suspendedYield.js -built-ins/AsyncGeneratorPrototype/next/request-queue-promise-resolve-order.js -built-ins/AsyncGeneratorPrototype/next/request-queue-order.js -built-ins/AsyncGeneratorPrototype/next/prop-desc.js -built-ins/AsyncGeneratorPrototype/next/iterator-result-prototype.js -built-ins/AsyncGeneratorPrototype/next/name.js -built-ins/AsyncGeneratorPrototype/next/length.js -built-ins/AsyncGeneratorPrototype/next/request-queue-await-order.js -built-ins/AsyncGeneratorPrototype/next/return-promise.js -built-ins/AsyncGeneratorPrototype/return/return-suspendedStart.js -built-ins/AsyncGeneratorPrototype/return/prop-desc.js -built-ins/AsyncGeneratorPrototype/return/return-suspendedYield.js -built-ins/AsyncGeneratorPrototype/return/iterator-result-prototype.js -built-ins/AsyncGeneratorPrototype/return/name.js -built-ins/AsyncGeneratorPrototype/return/return-state-completed.js -built-ins/AsyncGeneratorPrototype/return/length.js -built-ins/AsyncGeneratorPrototype/return/return-suspendedStart-promise.js -built-ins/AsyncGeneratorPrototype/return/return-promise.js -built-ins/AsyncGeneratorPrototype/return/return-suspendedYield-promise.js +language/expressions/optional-chaining/call-expression.js +language/expressions/optional-chaining/call-expression-super-no-base.js +language/expressions/optional-chaining/early-errors-tail-position-null-optchain-template-string-esi.js +language/expressions/optional-chaining/early-errors-tail-position-null-optchain-template-string.js +language/expressions/optional-chaining/early-errors-tail-position-null-op-template-string-esi.js +language/expressions/optional-chaining/early-errors-tail-position-null-op-template-string.js +language/expressions/optional-chaining/early-errors-tail-position-optchain-template-string-esi.js +language/expressions/optional-chaining/early-errors-tail-position-optchain-template-string.js +language/expressions/optional-chaining/early-errors-tail-position-op-template-string-esi.js +language/expressions/optional-chaining/early-errors-tail-position-op-template-string.js +language/expressions/optional-chaining/eval-optional-call.js +language/expressions/optional-chaining/iteration-statement-do.js +language/expressions/optional-chaining/iteration-statement-for-await-of.js +language/expressions/optional-chaining/iteration-statement-for-in.js +language/expressions/optional-chaining/iteration-statement-for.js +language/expressions/optional-chaining/iteration-statement-for-of-type-error.js +language/expressions/optional-chaining/iteration-statement-while.js +language/expressions/optional-chaining/member-expression-async-identifier.js +language/expressions/optional-chaining/member-expression-async-literal.js +language/expressions/optional-chaining/member-expression-async-this.js +language/expressions/optional-chaining/member-expression.js +language/expressions/optional-chaining/new-target-optional-call.js +language/expressions/optional-chaining/optional-call-preserves-this.js +language/expressions/optional-chaining/optional-chain-async-optional-chain-square-brackets.js +language/expressions/optional-chaining/optional-chain-async-square-brackets.js +language/expressions/optional-chaining/optional-chain-expression-optional-expression.js +language/expressions/optional-chaining/optional-chain.js +language/expressions/optional-chaining/optional-chain-prod-arguments.js +language/expressions/optional-chaining/optional-chain-prod-expression.js +language/expressions/optional-chaining/optional-chain-prod-identifiername.js +language/expressions/optional-chaining/optional-expression.js +language/expressions/optional-chaining/punctuator-decimal-lookahead.js +language/expressions/optional-chaining/runtime-semantics-evaluation.js +language/expressions/optional-chaining/short-circuiting.js +language/expressions/optional-chaining/static-semantics-simple-assignment.js +language/expressions/optional-chaining/super-property-optional-call.js +language/expressions/optional-chaining/update-expression-postfix.js +language/expressions/optional-chaining/update-expression-prefix.js diff --git a/test262/skip_tests.json b/test262/skip_tests.json index 62270aa0aa..eb57ff0fb8 100644 --- a/test262/skip_tests.json +++ b/test262/skip_tests.json @@ -676,7 +676,8 @@ "built-ins/Function/internals/Construct/derived-return-val-realm.js", "built-ins/Function/internals/Construct/base-ctor-revoked-proxy-realm.js", "built-ins/Function/internals/Call/class-ctor-realm.js", - "built-ins/Proxy/get-fn-realm-recursive.js" + "built-ins/Proxy/get-fn-realm-recursive.js", + "language/expressions/optional-chaining/eval-optional-call.js" ] }, { @@ -1625,7 +1626,9 @@ "built-ins/AsyncGeneratorPrototype/return/return-suspendedYield-try-finally-return.js", "built-ins/AsyncGeneratorPrototype/return/request-queue-order-state-executing.js", "built-ins/AsyncGeneratorPrototype/return/this-val-not-object.js", - "built-ins/AsyncGeneratorPrototype/return/return-suspendedYield-try-finally.js" + "built-ins/AsyncGeneratorPrototype/return/return-suspendedYield-try-finally.js", + "language/expressions/optional-chaining/member-expression.js", + "language/expressions/optional-chaining/iteration-statement-for-await-of.js" ] } -] \ No newline at end of file +] -- Gitee From 08f1e5406acdd86a8122844903364f27aca86608 Mon Sep 17 00:00:00 2001 From: huangyu Date: Tue, 20 Sep 2022 10:45:52 +0800 Subject: [PATCH 20/28] Integrate es2abc/ts2abc tests in gn building Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I5S9S6 Test: ts2abc_unittests, es2abc_parser_tsc_tests Signed-off-by: huangyu Change-Id: Ide7a6af8c46858173d1832f255844a507de4252d --- es2panda/BUILD.gn | 1 + es2panda/test/BUILD.gn | 14 ++ es2panda/test/runner.py | 6 + es2panda/test/test_tsc_ignore_list.txt | 177 +++++++++++++++++++++++++ testTs/config.py | 2 +- testTs/run_testTs.py | 13 +- ts2panda/BUILD.gn | 6 +- ts2panda/tests/BUILD.gn | 17 ++- 8 files changed, 228 insertions(+), 8 deletions(-) create mode 100644 es2panda/test/test_tsc_ignore_list.txt mode change 100644 => 100755 testTs/run_testTs.py diff --git a/es2panda/BUILD.gn b/es2panda/BUILD.gn index 847457188e..dabba07043 100644 --- a/es2panda/BUILD.gn +++ b/es2panda/BUILD.gn @@ -535,5 +535,6 @@ group("es2panda_build_win") { group("es2abc_tests") { deps = [ "./test:es2abc_parser_tests" ] + deps += [ "./test:es2abc_parser_tsc_tests" ] deps += [ "./test:es2abc_compiler_tests" ] } diff --git a/es2panda/test/BUILD.gn b/es2panda/test/BUILD.gn index 027287cc37..83e24f81f7 100644 --- a/es2panda/test/BUILD.gn +++ b/es2panda/test/BUILD.gn @@ -29,6 +29,20 @@ action("es2abc_parser_tests") { outputs = [ "${es2abc_build_path}/keep_es2abc_parser_tests_run" ] } +action("es2abc_parser_tsc_tests") { + script = "${es2abc_root}/test/runner.py" + + deps = es2abc_build_deps + + args = [ + "--no-progress", + "--tsc", + rebase_path("${es2abc_build_path}"), + ] + + outputs = [ "${es2abc_build_path}/keep_es2abc_parser_tsc_tests_run" ] +} + action("es2abc_compiler_tests") { script = "${es2abc_root}/test/runner.py" diff --git a/es2panda/test/runner.py b/es2panda/test/runner.py index 2ccecdf984..325cc15f8e 100755 --- a/es2panda/test/runner.py +++ b/es2panda/test/runner.py @@ -708,6 +708,8 @@ class TSCRunner(Runner): files = glob(glob_expression, recursive=True) files = fnmatch.filter(files, ts_suite_dir + '**' + self.args.filter) + failed_references = open(path.join(self.test_root, 'test_tsc_ignore_list.txt'), 'r').read() + for f in files: test_name = path.basename(f.split(".ts")[0]) negative_references = path.join( @@ -727,6 +729,10 @@ class TSCRunner(Runner): if is_negative or "filename" in test.options: continue + if self.args.skip: + if path.relpath(f, self.test_root) in failed_references: + continue + self.tests.append(test) def test_path(self, src): diff --git a/es2panda/test/test_tsc_ignore_list.txt b/es2panda/test/test_tsc_ignore_list.txt new file mode 100644 index 0000000000..d9a4bf7d7f --- /dev/null +++ b/es2panda/test/test_tsc_ignore_list.txt @@ -0,0 +1,177 @@ +es2panda/test/TypeScript/tests/cases/conformance/functions/functionWithUseStrictAndSimpleParameterList.ts +es2panda/test/TypeScript/tests/cases/conformance/externalModules/es6/es6modulekindWithES5Target12.ts +es2panda/test/TypeScript/tests/cases/conformance/externalModules/esnext/esnextmodulekindWithES5Target12.ts +es2panda/test/TypeScript/tests/cases/conformance/expressions/propertyAccess/propertyAccessNumericLiterals.ts +es2panda/test/TypeScript/tests/cases/conformance/expressions/typeGuards/typePredicateASI.ts +es2panda/test/TypeScript/tests/cases/conformance/expressions/typeGuards/typeGuardFunctionOfFormThis.ts +es2panda/test/TypeScript/tests/cases/conformance/expressions/nullishCoalescingOperator/nullishCoalescingOperator_es2020.ts +es2panda/test/TypeScript/tests/cases/conformance/expressions/elementAccess/letIdentifierInElementAccess01.ts +es2panda/test/TypeScript/tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.ts +es2panda/test/TypeScript/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface04.ts +es2panda/test/TypeScript/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface01.ts +es2panda/test/TypeScript/tests/cases/conformance/interfaces/interfaceDeclarations/asiPreventsParsingAsInterface03.ts +es2panda/test/TypeScript/tests/cases/conformance/classes/members/privateNames/privateNameComputedPropertyName1.ts +es2panda/test/TypeScript/tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.ts +es2panda/test/TypeScript/tests/cases/conformance/internalModules/importDeclarations/importAliasIdentifiers.ts +es2panda/test/TypeScript/tests/cases/conformance/internalModules/importDeclarations/exportImportAlias.ts +es2panda/test/TypeScript/tests/cases/conformance/internalModules/moduleDeclarations/asiPreventsParsingAsNamespace04.ts +es2panda/test/TypeScript/tests/cases/conformance/internalModules/moduleDeclarations/nonInstantiatedModule.ts +es2panda/test/TypeScript/tests/cases/conformance/classes/classDeclarations/mergeClassInterfaceAndModule.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/destructuring/declarationInAmbientContext.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagNamedDeclare.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTagsES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/templates/templateStringControlCharacterEscapes01.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/templates/templateStringControlCharacterEscapes01_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTagNamedDeclareES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration2_es6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration4_es6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/for-ofStatements/for-of53.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/for-ofStatements/for-of56.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInRegularExpressions14_ES5.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInRegularExpressions07_ES5.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInRegularExpressions12_ES5.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInRegularExpressions17_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInRegularExpressions19_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInRegularExpressions12_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInRegularExpressions14_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInRegularExpressions07_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInRegularExpressions19_ES5.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInRegularExpressions17_ES5.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck38.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments08_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral2.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/modules/defaultExportWithOverloads01.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments13.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts +es2panda/test/TypeScript/tests/cases/conformance/async/es6/asyncAwait_es6.ts +es2panda/test/TypeScript/tests/cases/conformance/async/es6/asyncWithVarShadowing_es6.ts +es2panda/test/TypeScript/tests/cases/conformance/async/es5/asyncAwait_es5.ts +es2panda/test/TypeScript/tests/cases/conformance/async/es2017/asyncAwait_es2017.ts +es2panda/test/TypeScript/tests/cases/conformance/types/typeParameters/typeArgumentLists/constraintSatisfactionWithEmptyObject.ts +es2panda/test/TypeScript/tests/cases/conformance/types/tuple/named/namedTupleMembers.ts +es2panda/test/TypeScript/tests/cases/conformance/types/uniqueSymbol/uniqueSymbols.ts +es2panda/test/TypeScript/tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsDeclarations.ts +es2panda/test/TypeScript/tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/nullIsSubtypeOfEverythingButUndefined.ts +es2panda/test/TypeScript/tests/cases/conformance/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType2.ts +es2panda/test/TypeScript/tests/cases/conformance/types/typeRelationships/bestCommonType/heterogeneousArrayLiterals.ts +es2panda/test/TypeScript/tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/undefinedIsSubtypeOfEverything.ts +es2panda/test/TypeScript/tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfAny.ts +es2panda/test/TypeScript/tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints2.ts +es2panda/test/TypeScript/tests/cases/conformance/types/typeRelationships/assignmentCompatibility/anyAssignabilityInInheritance.ts +es2panda/test/TypeScript/tests/cases/conformance/types/stringLiteral/stringLiteralTypesAndParenthesizedExpressions01.ts +es2panda/test/TypeScript/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts +es2panda/test/TypeScript/tests/cases/conformance/types/import/importTypeAmbient.ts +es2panda/test/TypeScript/tests/cases/conformance/types/specifyingTypes/typeQueries/typeQueryWithReservedWords.ts +es2panda/test/TypeScript/tests/cases/conformance/types/members/objectTypeWithStringNamedNumericProperty.ts +es2panda/test/TypeScript/tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutReturnTypeAnnotationInference.ts +es2panda/test/TypeScript/tests/cases/conformance/types/literal/literalTypesAndDestructuring.ts +es2panda/test/TypeScript/tests/cases/conformance/parser/ecmascript5/parserUnicodeWhitespaceCharacter1.ts +es2panda/test/TypeScript/tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression6.ts +es2panda/test/TypeScript/tests/cases/conformance/parser/ecmascript5/RegressionTests/parser579071.ts +es2panda/test/TypeScript/tests/cases/conformance/parser/ecmascript5/Statements/ContinueStatements/parser_continueTarget3.ts +es2panda/test/TypeScript/tests/cases/compiler/multiModuleClodule1.ts +es2panda/test/TypeScript/tests/cases/compiler/discriminantsAndPrimitives.ts +es2panda/test/TypeScript/tests/cases/compiler/circularTypeofWithFunctionModule.ts +es2panda/test/TypeScript/tests/cases/compiler/collisionArgumentsInType.ts +es2panda/test/TypeScript/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.ts +es2panda/test/TypeScript/tests/cases/compiler/ambientClassOverloadForFunction.ts +es2panda/test/TypeScript/tests/cases/compiler/doubleUnderscoreEnumEmit.ts +es2panda/test/TypeScript/tests/cases/compiler/parseArrowFunctionWithFunctionReturnType.ts +es2panda/test/TypeScript/tests/cases/compiler/augmentedTypesModules3b.ts +es2panda/test/TypeScript/tests/cases/compiler/computedPropertiesTransformedInOtherwiseNonTSClasses.ts +es2panda/test/TypeScript/tests/cases/compiler/castTest.ts +es2panda/test/TypeScript/tests/cases/compiler/constructorOverloads5.ts +es2panda/test/TypeScript/tests/cases/compiler/parameterInitializerBeforeDestructuringEmit.ts +es2panda/test/TypeScript/tests/cases/compiler/classDeclarationMergedInModuleWithContinuation.ts +es2panda/test/TypeScript/tests/cases/compiler/exportEqualsOfModule.ts +es2panda/test/TypeScript/tests/cases/compiler/arrowFunctionWithObjectLiteralBody6.ts +es2panda/test/TypeScript/tests/cases/compiler/getterSetterNonAccessor.ts +es2panda/test/TypeScript/tests/cases/compiler/systemNamespaceAliasEmit.ts +es2panda/test/TypeScript/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.ts +es2panda/test/TypeScript/tests/cases/compiler/resolveModuleNameWithSameLetDeclarationName1.ts +es2panda/test/TypeScript/tests/cases/compiler/partiallyAmbientFundule.ts +es2panda/test/TypeScript/tests/cases/compiler/internalImportInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts +es2panda/test/TypeScript/tests/cases/compiler/collisionArgumentsInterfaceMembers.ts +es2panda/test/TypeScript/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts +es2panda/test/TypeScript/tests/cases/compiler/es5ExportEqualsDts.ts +es2panda/test/TypeScript/tests/cases/compiler/parseEntityNameWithReservedWord.ts +es2panda/test/TypeScript/tests/cases/compiler/exportDeclarationsInAmbientNamespaces.ts +es2panda/test/TypeScript/tests/cases/compiler/castOfAwait.ts +es2panda/test/TypeScript/tests/cases/compiler/objectLitGetterSetter.ts +es2panda/test/TypeScript/tests/cases/compiler/continueTarget3.ts +es2panda/test/TypeScript/tests/cases/compiler/letInVarDeclOfForIn_ES6.ts +es2panda/test/TypeScript/tests/cases/compiler/functionMergedWithModule.ts +es2panda/test/TypeScript/tests/cases/compiler/internalImportUnInstantiatedModuleMergedWithClassNotReferencingInstanceNoConflict.ts +es2panda/test/TypeScript/tests/cases/compiler/controlFlowManyCallExpressionStatementsPerf.ts +es2panda/test/TypeScript/tests/cases/compiler/declareIdentifierAsBeginningOfStatementExpression01.ts +es2panda/test/TypeScript/tests/cases/compiler/declarationEmitLocalClassHasRequiredDeclare.ts +es2panda/test/TypeScript/tests/cases/compiler/isLiteral2.ts +es2panda/test/TypeScript/tests/cases/compiler/exportImportAndClodule.ts +es2panda/test/TypeScript/tests/cases/compiler/genericCloduleInModule.ts +es2panda/test/TypeScript/tests/cases/compiler/shebang.ts +es2panda/test/TypeScript/tests/cases/compiler/arrowFunctionWithObjectLiteralBody5.ts +es2panda/test/TypeScript/tests/cases/compiler/partiallyAmbientClodule.ts +es2panda/test/TypeScript/tests/cases/compiler/overloadResolutionOverNonCTObjectLit.ts +es2panda/test/TypeScript/tests/cases/compiler/controlFlowCaching.ts +es2panda/test/TypeScript/tests/cases/compiler/overloadedConstructorFixesInferencesAppropriately.ts +es2panda/test/TypeScript/tests/cases/compiler/multiModuleFundule1.ts +es2panda/test/TypeScript/tests/cases/compiler/systemModuleDeclarationMerging.ts +es2panda/test/TypeScript/tests/cases/compiler/bom-utf16be.ts +es2panda/test/TypeScript/tests/cases/compiler/isLiteral1.ts +es2panda/test/TypeScript/tests/cases/compiler/sourceMapValidationDecorators.ts +es2panda/test/TypeScript/tests/cases/compiler/cloduleGenericOnSelfMember.ts +es2panda/test/TypeScript/tests/cases/compiler/unusedLocalsAndParametersOverloadSignatures.ts +es2panda/test/TypeScript/tests/cases/compiler/noCircularDefinitionOnExportOfPrivateInMergedNamespace.ts +es2panda/test/TypeScript/tests/cases/compiler/inferenceErasedSignatures.ts +es2panda/test/TypeScript/tests/cases/compiler/exportSpecifierAndExportedMemberDeclaration.ts +es2panda/test/TypeScript/tests/cases/compiler/elidedEmbeddedStatementsReplacedWithSemicolon.ts +es2panda/test/TypeScript/tests/cases/compiler/letInVarDeclOfForOf_ES5.ts +es2panda/test/TypeScript/tests/cases/compiler/declarationEmitDestructuringOptionalBindingParametersInOverloads.ts +es2panda/test/TypeScript/tests/cases/compiler/moduleRedifinitionErrors.ts +es2panda/test/TypeScript/tests/cases/compiler/globalIsContextualKeyword.ts +es2panda/test/TypeScript/tests/cases/compiler/exportRedeclarationTypeAliases.ts +es2panda/test/TypeScript/tests/cases/compiler/letAsIdentifier2.ts +es2panda/test/TypeScript/tests/cases/compiler/fileWithNextLine2.ts +es2panda/test/TypeScript/tests/cases/compiler/mutuallyRecursiveInterfaceDeclaration.ts +es2panda/test/TypeScript/tests/cases/compiler/funduleOfFunctionWithoutReturnTypeAnnotation.ts +es2panda/test/TypeScript/tests/cases/compiler/implementsInClassExpression.ts +es2panda/test/TypeScript/tests/cases/compiler/funduleExportedClassIsUsedBeforeDeclaration.ts +es2panda/test/TypeScript/tests/cases/compiler/genericOfACloduleType2.ts +es2panda/test/TypeScript/tests/cases/compiler/genericOfACloduleType1.ts +es2panda/test/TypeScript/tests/cases/compiler/mixingFunctionAndAmbientModule1.ts +es2panda/test/TypeScript/tests/cases/compiler/cloduleWithPriorUninstantiatedModule.ts +es2panda/test/TypeScript/tests/cases/compiler/emitDecoratorMetadata_restArgs.ts +es2panda/test/TypeScript/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts +es2panda/test/TypeScript/tests/cases/compiler/augmentedTypesClass3.ts +es2panda/test/TypeScript/tests/cases/compiler/cloduleTest1.ts +es2panda/test/TypeScript/tests/cases/compiler/taggedTemplateStringWithSymbolExpression01.ts +es2panda/test/TypeScript/tests/cases/compiler/cloduleAndTypeParameters.ts +es2panda/test/TypeScript/tests/cases/compiler/privacyCheckExportAssignmentOnExportedGenericInterface2.ts +es2panda/test/TypeScript/tests/cases/compiler/exportAsNamespace.d.ts +es2panda/test/TypeScript/tests/cases/compiler/letInVarDeclOfForOf_ES6.ts +es2panda/test/TypeScript/tests/cases/compiler/emitBundleWithShebang1.ts +es2panda/test/TypeScript/tests/cases/compiler/recursiveCloduleReference.ts +es2panda/test/TypeScript/tests/cases/compiler/letInVarDeclOfForIn_ES5.ts +es2panda/test/TypeScript/tests/cases/compiler/mergedDeclarations1.ts +es2panda/test/TypeScript/tests/cases/compiler/augmentedTypesExternalModule1.ts +es2panda/test/TypeScript/tests/cases/compiler/sigantureIsSubTypeIfTheyAreIdentical.ts +es2panda/test/TypeScript/tests/cases/compiler/assertionFunctionsCanNarrowByDiscriminant.ts +es2panda/test/TypeScript/tests/cases/compiler/withStatementInternalComments.ts +es2panda/test/TypeScript/tests/cases/compiler/genericRecursiveImplicitConstructorErrors2.ts +es2panda/test/TypeScript/tests/cases/compiler/cloduleWithRecursiveReference.ts +es2panda/test/TypeScript/tests/cases/compiler/sourceMap-LineBreaks.ts +es2panda/test/TypeScript/tests/cases/compiler/declareExternalModuleWithExportAssignedFundule.ts +es2panda/test/TypeScript/tests/cases/compiler/classFunctionMerging.ts \ No newline at end of file diff --git a/testTs/config.py b/testTs/config.py index 14ec255458..cec2f8135e 100644 --- a/testTs/config.py +++ b/testTs/config.py @@ -30,8 +30,8 @@ OUT_RESULT_FILE = os.path.join("out", "testTs", "result.txt") TEST_DIR = os.path.join("testTs") TS_CASES_DIR = os.path.join(".", "testTs", "test") SKIP_FILE_PATH = os.path.join("testTs", "skip_tests.json") -IMPORT_FILE_PATH = os.path.join("testTs", "import_tests.json") CUR_FILE_DIR = os.path.dirname(__file__) +IMPORT_FILE_PATH = os.path.join(CUR_FILE_DIR, "import_tests.json") CODE_ROOT = os.path.abspath(os.path.join(CUR_FILE_DIR, "../../..")) ARK_DIR = f"{CODE_ROOT}/out/hispark_taurus/clang_x64/ark/ark" WORK_PATH = f'{CODE_ROOT}/arkcompiler/ets_frontend' diff --git a/testTs/run_testTs.py b/testTs/run_testTs.py old mode 100644 new mode 100755 index 3ab0e31f67..1485329a4d --- a/testTs/run_testTs.py +++ b/testTs/run_testTs.py @@ -229,7 +229,7 @@ def compare(file, flag=False): def summary(): if not os.path.exists(OUT_RESULT_FILE): - return + return 1 count = -1 fail_count = 0 with open(OUT_RESULT_FILE, 'r') as read_outfile: @@ -247,6 +247,8 @@ def summary(): print(" Failed tests: %5d " % (fail_count)) print("===============================") + return 0 if fail_count == 0 else 1 + def init_path(): remove_dir(OUT_TEST_DIR) @@ -284,7 +286,7 @@ def test_instype(args): mk_dir(outpath) # source ts files - files = glob('./testTs/instype/*.ts'); + files = glob(os.path.join(CUR_FILE_DIR, './instype/*.ts')); ark_frontend_tool = DEFAULT_ARK_FRONTEND_TOOL if args.ark_frontend_tool: ark_frontend_tool = args.ark_frontend_tool @@ -325,19 +327,22 @@ def test_instype(args): print("\033[91mFailed: %5d" % (len(fail_list))) print("\033[0m") + return 0 if len(fail_list) == 0 else 1 def main(args): try: init_path() if (args.testinstype): - test_instype(args) + excuting_npm_install(args) + return test_instype(args) else: excuting_npm_install(args) prepare_ts_code() run_test_machine(args) - summary() + return summary() except BaseException: print("Run Python Script Fail") + return 1 if __name__ == "__main__": diff --git a/ts2panda/BUILD.gn b/ts2panda/BUILD.gn index 635a2fb82c..82f0b07209 100755 --- a/ts2panda/BUILD.gn +++ b/ts2panda/BUILD.gn @@ -264,6 +264,10 @@ ohos_copy("copy_ts2abc_tests") { group("ts2abc_unittests") { if (host_os == "linux") { testonly = true - deps = [ "tests:ts2abc_tests(${toolchain_linux})" ] + deps = [ + "tests:ts2abc_ts_instruction_type_test(${toolchain_linux})", + "tests:ts2abc_ts_type_system_test(${toolchain_linux})", + "tests:ts2abc_ts_ut_test(${toolchain_linux})", + ] } } diff --git a/ts2panda/tests/BUILD.gn b/ts2panda/tests/BUILD.gn index 1da6e41ffb..57eaa7a17e 100644 --- a/ts2panda/tests/BUILD.gn +++ b/ts2panda/tests/BUILD.gn @@ -15,7 +15,20 @@ import("//arkcompiler/ets_frontend/ts2panda/ts2abc_config.gni") import("//build/config/clang/clang.gni") import("//build/ohos.gni") -action("ts2abc_tests") { +action("ts2abc_ts_type_system_test") { + script = "${ts2abc_root}/../testTs/run_testTs.py" + deps = [ "${ts2abc_root}:copy_ts2abc_tests" ] + outputs = [ "$target_out_dir/ts2abc_ts_type_system_test/" ] +} + +action("ts2abc_ts_instruction_type_test") { + script = "${ts2abc_root}/../testTs/run_testTs.py" + deps = [ "${ts2abc_root}:copy_ts2abc_tests" ] + args = [ "--testinstype" ] + outputs = [ "$target_out_dir/ts2abc_ts_instruction_type_test/" ] +} + +action("ts2abc_ts_ut_test") { script = "${ts2abc_root}/scripts/run_tests.py" deps = [ "${ts2abc_root}:copy_ts2abc_tests" ] @@ -44,5 +57,5 @@ action("ts2abc_tests") { "win", ] } - outputs = [ "$target_out_dir/ts2abc_tests/" ] + outputs = [ "$target_out_dir/ts2abc_ts_ut_test/" ] } -- Gitee From 4b90e9d2c5131db4ffb4efde978bb13393ad6356 Mon Sep 17 00:00:00 2001 From: hufeng Date: Sat, 24 Sep 2022 10:53:42 +0800 Subject: [PATCH 21/28] Adapt [AsyncGenerator] to ES2ABC by transplanting the TS2ABC's implementation Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I5SNTC?from=project-issue Signed-off-by: hufeng Change-Id: I520a0062fac1d2f3777c975193afa2f2c4d10292 --- es2panda/compiler/core/pandagen.cpp | 21 ++----- es2panda/compiler/core/pandagen.h | 4 +- .../asyncGeneratorFunctionBuilder.cpp | 63 ++++++++++--------- 3 files changed, 42 insertions(+), 46 deletions(-) diff --git a/es2panda/compiler/core/pandagen.cpp b/es2panda/compiler/core/pandagen.cpp index e56e28c72d..ef06720971 100644 --- a/es2panda/compiler/core/pandagen.cpp +++ b/es2panda/compiler/core/pandagen.cpp @@ -1101,7 +1101,7 @@ void PandaGen::DefineFunction(const ir::AstNode *node, const ir::ScriptFunction ra_.Emit(node, name, static_cast(formalParamCnt), LexEnv()); } else if (realNode->IsAsync()) { if (realNode->IsGenerator()) { - // TODO(): async generator + ra_.Emit(node, name, static_cast(formalParamCnt), LexEnv()); } else { ra_.Emit(node, name, static_cast(formalParamCnt), LexEnv()); } @@ -1166,10 +1166,7 @@ void PandaGen::CreateGeneratorObj(const ir::AstNode *node, VReg funcObj) void PandaGen::CreateAsyncGeneratorObj(const ir::AstNode *node, VReg funcObj) { - /* - * TODO: async generator - * ra_.Emit(node, funcObj); - */ + ra_.Emit(node, funcObj); } void PandaGen::CreateIterResultObject(const ir::AstNode *node, VReg value, VReg done) @@ -1236,20 +1233,14 @@ void PandaGen::AsyncFunctionReject(const ir::AstNode *node, VReg asyncFuncObj, V ra_.Emit(node, asyncFuncObj, canSuspend, value); } -void PandaGen::AsyncGeneratorResolve(const ir::AstNode *node, VReg asyncGenObj) +void PandaGen::AsyncGeneratorResolve(const ir::AstNode *node, VReg asyncGenObj, VReg value, VReg canSuspend) { - /* - * TODO: async generator resolve - * ra_.Emit(node, asyncGenObj); - */ + ra_.Emit(node, asyncGenObj, value, canSuspend); } -void PandaGen::AsyncGeneratorReject(const ir::AstNode *node, VReg asyncGenObj) +void PandaGen::AsyncGeneratorReject(const ir::AstNode *node, VReg asyncGenObj, VReg value) { - /* - * TODO: async generator reject - * ra_.Emit(node, asyncGenObj); - */ + ra_.Emit(node, asyncGenObj, value); } void PandaGen::GetTemplateObject(const ir::AstNode *node, VReg value) diff --git a/es2panda/compiler/core/pandagen.h b/es2panda/compiler/core/pandagen.h index 64fe2d6132..ffc4ebbcff 100644 --- a/es2panda/compiler/core/pandagen.h +++ b/es2panda/compiler/core/pandagen.h @@ -318,8 +318,8 @@ public: void SuspendGenerator(const ir::AstNode *node, VReg genObj, VReg iterResult); void SuspendAsyncGenerator(const ir::AstNode *node, VReg asyncGenObj); - void AsyncGeneratorResolve(const ir::AstNode *node, VReg asyncGenObj); - void AsyncGeneratorReject(const ir::AstNode *node, VReg asyncGenObj); + void AsyncGeneratorResolve(const ir::AstNode *node, VReg asyncGenObj, VReg value, VReg canSuspend); + void AsyncGeneratorReject(const ir::AstNode *node, VReg asyncGenObj, VReg value); void GetTemplateObject(const ir::AstNode *node, VReg value); void CopyRestArgs(const ir::AstNode *node, uint32_t index); diff --git a/es2panda/compiler/function/asyncGeneratorFunctionBuilder.cpp b/es2panda/compiler/function/asyncGeneratorFunctionBuilder.cpp index a74eea46df..157410a4b7 100644 --- a/es2panda/compiler/function/asyncGeneratorFunctionBuilder.cpp +++ b/es2panda/compiler/function/asyncGeneratorFunctionBuilder.cpp @@ -22,28 +22,45 @@ namespace panda::es2panda::compiler { void AsyncGeneratorFunctionBuilder::Prepare(const ir::ScriptFunction *node) { + RegScope rs(pg_); VReg callee = FunctionReg(node); + VReg completionType = pg_->AllocReg(); + VReg completionValue = pg_->AllocReg(); pg_->CreateAsyncGeneratorObj(node, callee); pg_->StoreAccumulator(node, funcObj_); - // pg_->SuspendGenerator(node, funcObj_); TODO implement this part correctly while implementing async generator + pg_->SetLabel(node, catchTable_->LabelSet().TryBegin()); + + pg_->LoadConst(node, Constant::JS_UNDEFINED); + SuspendResumeExecution(node, completionType, completionValue); } void AsyncGeneratorFunctionBuilder::CleanUp(const ir::ScriptFunction *node) const { const auto &labelSet = catchTable_->LabelSet(); + RegScope rs(pg_); + VReg value = pg_->AllocReg(); + pg_->SetLabel(node, labelSet.TryEnd()); pg_->SetLabel(node, labelSet.CatchBegin()); - pg_->AsyncGeneratorReject(node, funcObj_); + pg_->StoreAccumulator(node, value); + pg_->AsyncGeneratorReject(node, funcObj_, value); pg_->EmitReturn(node); pg_->SetLabel(node, labelSet.CatchEnd()); } void AsyncGeneratorFunctionBuilder::DirectReturn(const ir::AstNode *node) const { - pg_->AsyncGeneratorResolve(node, funcObj_); + RegScope rs(pg_); + VReg retVal = pg_->AllocReg(); + VReg canSuspend = pg_->AllocReg(); + + pg_->StoreAccumulator(node, retVal); + pg_->StoreConst(node, canSuspend, Constant::JS_TRUE); + + pg_->AsyncGeneratorResolve(node, funcObj_, retVal, canSuspend); pg_->EmitReturn(node); } @@ -55,48 +72,36 @@ void AsyncGeneratorFunctionBuilder::ImplicitReturn(const ir::AstNode *node) cons void AsyncGeneratorFunctionBuilder::Yield(const ir::AstNode *node) { - Await(node); - RegScope rs(pg_); + VReg value = pg_->AllocReg(); + VReg done = pg_->AllocReg(); VReg completionType = pg_->AllocReg(); VReg completionValue = pg_->AllocReg(); - AsyncYield(node, completionType, completionValue); - - auto *notReturnCompletion = pg_->AllocLabel(); - auto *normalCompletion = pg_->AllocLabel(); + auto *notNextCompletion = pg_->AllocLabel(); auto *notThrowCompletion = pg_->AllocLabel(); - // 27.6.3.8.8.a. If resumptionValue.[[Type]] is not return - pg_->LoadAccumulatorInt(node, static_cast(ResumeMode::RETURN)); - pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, completionType, notReturnCompletion); - // 27.6.3.8.8.b. Let awaited be Await(resumptionValue.[[Value]]). - pg_->LoadAccumulator(node, completionValue); - pg_->AsyncFunctionAwait(node, funcObj_, completionValue); + pg_->StoreAccumulator(node, value); + pg_->StoreConst(node, done, Constant::JS_FALSE); + pg_->AsyncGeneratorResolve(node, funcObj_, value, done); SuspendResumeExecution(node, completionType, completionValue); - // 27.6.3.8.8.c. If awaited.[[Type]] is throw, return Completion(awaited). - pg_->LoadAccumulatorInt(node, static_cast(ResumeMode::THROW)); - - pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, completionType, normalCompletion); + // .next(value) + pg_->LoadAccumulatorInt(node, static_cast(ResumeMode::NEXT)); + pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, completionType, notNextCompletion); pg_->LoadAccumulator(node, completionValue); - pg_->EmitThrow(node); - - pg_->SetLabel(node, normalCompletion); - // 27.6.3.8.8.d. Assert: awaited.[[Type]] is normal. - // 27.6.3.8.8.e. Return Completion { [[Type]]: return, [[Value]]: awaited.[[Value]], [[Target]]: empty }. - pg_->ControlFlowChangeBreak(); - pg_->LoadAccumulator(node, completionValue); - pg_->DirectReturn(node); - pg_->SetLabel(node, notReturnCompletion); - // 27.6.3.8.8.a. return Completion(resumptionValue). + // .throw(value) + pg_->SetLabel(node, notNextCompletion); pg_->LoadAccumulatorInt(node, static_cast(ResumeMode::THROW)); pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, completionType, notThrowCompletion); pg_->LoadAccumulator(node, completionValue); pg_->EmitThrow(node); + + // .return(value) pg_->SetLabel(node, notThrowCompletion); pg_->LoadAccumulator(node, completionValue); + pg_->EmitReturn(node); } IteratorType AsyncGeneratorFunctionBuilder::GeneratorKind() const -- Gitee From 4c9a8764ae862de1a7d6db3597b21bd54b286503 Mon Sep 17 00:00:00 2001 From: ctw-ian Date: Sat, 24 Sep 2022 16:24:40 +0800 Subject: [PATCH 22/28] ISA modification of es2abc Issue:I5QWXL Signed-off-by: ctw-ian Change-Id: I8bb732bb4e5469c77a7649847f9518ec383d3234 --- es2panda/binder/binder.cpp | 9 + es2panda/binder/binder.h | 1 + es2panda/binder/scope.cpp | 8 + es2panda/binder/scope.h | 2 + es2panda/binder/variable.h | 13 + es2panda/compiler/base/destructuring.cpp | 16 +- es2panda/compiler/base/hoisting.cpp | 6 +- es2panda/compiler/core/compilerContext.cpp | 5 +- es2panda/compiler/core/compilerContext.h | 9 +- es2panda/compiler/core/compilerImpl.cpp | 2 +- es2panda/compiler/core/emitter/emitter.cpp | 12 + es2panda/compiler/core/emitter/emitter.h | 2 + es2panda/compiler/core/envScope.cpp | 7 +- es2panda/compiler/core/envScope.h | 8 +- es2panda/compiler/core/function.cpp | 9 +- es2panda/compiler/core/pandagen.cpp | 701 +++++++++++------- es2panda/compiler/core/pandagen.h | 78 +- es2panda/compiler/core/regAllocator.cpp | 25 +- es2panda/compiler/core/regAllocator.h | 8 +- es2panda/compiler/core/regScope.cpp | 2 +- .../function/asyncFunctionBuilder.cpp | 12 +- .../compiler/function/functionBuilder.cpp | 12 +- es2panda/compiler/templates/isa.h.erb | 74 +- es2panda/ir/base/classDefinition.cpp | 3 +- es2panda/ir/expressions/callExpression.cpp | 1 - es2panda/ir/expressions/importExpression.cpp | 5 +- .../ir/expressions/literals/regExpLiteral.cpp | 4 +- es2panda/ir/expressions/newExpression.cpp | 8 +- es2panda/ir/expressions/objectExpression.cpp | 13 +- es2panda/ir/irnode.h | 5 + .../ir/module/exportDefaultDeclaration.cpp | 5 +- .../parser/module/sourceTextModuleRecord.cpp | 19 + .../parser/module/sourceTextModuleRecord.h | 6 + es2panda/util/helpers.h | 2 + es2panda/util/hotfix.cpp | 20 +- 35 files changed, 728 insertions(+), 384 deletions(-) diff --git a/es2panda/binder/binder.cpp b/es2panda/binder/binder.cpp index 43a98efbaa..a094a339ee 100644 --- a/es2panda/binder/binder.cpp +++ b/es2panda/binder/binder.cpp @@ -93,6 +93,12 @@ void Binder::ThrowUndeclaredExport(const lexer::SourcePosition &pos, const util: throw Error(ErrorType::SYNTAX, ss.str(), loc.line, loc.col); } +void Binder::AssignIndexToModuleVariable() +{ + ASSERT(program_->ModuleRecord()); + program_->ModuleRecord()->AssignIndexToModuleVariable(topScope_->AsModuleScope()); +} + void Binder::IdentifierAnalysis() { ASSERT(program_->Ast()); @@ -101,6 +107,9 @@ void Binder::IdentifierAnalysis() BuildFunction(topScope_, MAIN_FUNC_NAME); ResolveReferences(program_->Ast()); AddMandatoryParams(); + if (topScope_->IsModuleScope()) { + AssignIndexToModuleVariable(); + } } void Binder::ValidateExportDecl(const ir::ExportNamedDeclaration *exportDecl) diff --git a/es2panda/binder/binder.h b/es2panda/binder/binder.h index 7f07e686e2..e9213c472e 100644 --- a/es2panda/binder/binder.h +++ b/es2panda/binder/binder.h @@ -161,6 +161,7 @@ private: } void AddMandatoryParams(); + void AssignIndexToModuleVariable(); void BuildFunction(FunctionScope *funcScope, util::StringView name); void BuildScriptFunction(Scope *outerScope, const ir::ScriptFunction *scriptFunc); void BuildClassDefinition(ir::ClassDefinition *classDef); diff --git a/es2panda/binder/scope.cpp b/es2panda/binder/scope.cpp index 21649a4b8c..634676482a 100644 --- a/es2panda/binder/scope.cpp +++ b/es2panda/binder/scope.cpp @@ -358,6 +358,14 @@ void ModuleScope::ConvertLocalVariableToModuleVariable(ArenaAllocator *allocator } } +void ModuleScope::AssignIndexToModuleVariable(util::StringView name, uint32_t index) +{ + auto *moduleVar = FindLocal(name); + ASSERT(moduleVar != nullptr); + ASSERT(moduleVar->IsModuleVariable()); + moduleVar->AsModuleVariable()->AssignIndex(index); +} + bool ModuleScope::AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, [[maybe_unused]] ScriptExtension extension) { diff --git a/es2panda/binder/scope.h b/es2panda/binder/scope.h index ad0783e33b..94b3791028 100644 --- a/es2panda/binder/scope.h +++ b/es2panda/binder/scope.h @@ -599,6 +599,8 @@ public: return ScopeType::MODULE; } + void AssignIndexToModuleVariable(util::StringView name, uint32_t index); + void ConvertLocalVariableToModuleVariable(ArenaAllocator *allocator, util::StringView localName); bool AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, diff --git a/es2panda/binder/variable.h b/es2panda/binder/variable.h index 80086ef9f6..a17b88885a 100644 --- a/es2panda/binder/variable.h +++ b/es2panda/binder/variable.h @@ -184,6 +184,19 @@ public: } void SetLexical([[maybe_unused]] Scope *scope, [[maybe_unused]] util::Hotfix *hotfixHelper = nullptr) override; + + void AssignIndex(uint32_t index) + { + index_ = index; + } + + uint32_t Index() const + { + return index_; + } + +private: + uint32_t index_; }; class EnumVariable : public Variable { diff --git a/es2panda/compiler/base/destructuring.cpp b/es2panda/compiler/base/destructuring.cpp index 70d9ef0754..5761a02177 100644 --- a/es2panda/compiler/base/destructuring.cpp +++ b/es2panda/compiler/base/destructuring.cpp @@ -145,8 +145,8 @@ static void GenArray(PandaGen *pg, const ir::ArrayExpression *array) pg->SetLabel(array, labelSet.CatchEnd()); } -static void GenObjectProperty(PandaGen *pg, const ir::ObjectExpression *object, const ir::Expression *element, - VReg value, VReg propReg) +static void GenObjectProperty(PandaGen *pg, const ir::ObjectExpression *object, + const ir::Expression *element, VReg value) { RegScope propScope(pg); VReg loadedValue = pg->AllocReg(); @@ -169,12 +169,10 @@ static void GenObjectProperty(PandaGen *pg, const ir::ObjectExpression *object, key->Compile(pg); } - pg->StoreAccumulator(key, propReg); - LReference lref = LReference::CreateLRef(pg, target, object->IsDeclaration()); // load obj property from rhs, return undefined if no corresponding property exists - pg->LoadObjByValue(element, value, propReg); + pg->LoadObjByValue(element, value); pg->StoreAccumulator(element, loadedValue); if (init != nullptr) { @@ -211,8 +209,7 @@ static void GenObjectWithRest(PandaGen *pg, const ir::ObjectExpression *object, break; } - VReg propReg = pg->AllocReg(); - GenObjectProperty(pg, object, element, rhs, propReg); + GenObjectProperty(pg, object, element, rhs); } } @@ -241,10 +238,7 @@ static void GenObject(PandaGen *pg, const ir::ObjectExpression *object, VReg rhs } for (const auto *element : properties) { - RegScope rs(pg); - VReg propReg = pg->AllocReg(); - - GenObjectProperty(pg, object, element, rhs, propReg); + GenObjectProperty(pg, object, element, rhs); } } diff --git a/es2panda/compiler/base/hoisting.cpp b/es2panda/compiler/base/hoisting.cpp index e8b61fc97d..5f5b6370b6 100644 --- a/es2panda/compiler/base/hoisting.cpp +++ b/es2panda/compiler/base/hoisting.cpp @@ -27,7 +27,9 @@ static void StoreModuleVarOrLocalVar(PandaGen *pg, binder::ScopeFindResult &resu { if (decl->IsImportOrExportDecl()) { ASSERT(pg->Scope()->IsModuleScope()); - pg->StoreModuleVariable(decl->Node(), decl->Name()); + auto *var = pg->Scope()->FindLocal(decl->Name()); + ASSERT(var->IsModuleVariable()); + pg->StoreModuleVariable(decl->Node(), var->AsModuleVariable()); } else { pg->StoreAccToLexEnv(decl->Node(), result, true); } @@ -84,7 +86,7 @@ static void HoistNameSpaceImports(PandaGen *pg) ASSERT(var != nullptr); auto *node = var->Declaration()->Node(); ASSERT(node != nullptr); - pg->GetModuleNamespace(node, nameSpaceEntry->localName_); + pg->GetModuleNamespace(node, nameSpaceEntry->moduleRequestIdx_); pg->StoreVar(node, {nameSpaceEntry->localName_, pg->TopScope(), 0, var}, true); } } diff --git a/es2panda/compiler/core/compilerContext.cpp b/es2panda/compiler/core/compilerContext.cpp index 81434e630b..f3549110db 100644 --- a/es2panda/compiler/core/compilerContext.cpp +++ b/es2panda/compiler/core/compilerContext.cpp @@ -20,9 +20,10 @@ namespace panda::es2panda::compiler { CompilerContext::CompilerContext(binder::Binder *binder, bool isDebug, bool isDebuggerEvaluateExpressionMode, - bool isMergeAbc, std::string sourceFile) + bool isMergeAbc, std::string sourceFile, util::StringView recordName) : binder_(binder), isDebug_(isDebug), isDebuggerEvaluateExpressionMode_(isDebuggerEvaluateExpressionMode), - isMergeAbc_(isMergeAbc), sourceFile_(sourceFile), emitter_(std::make_unique(this)) + isMergeAbc_(isMergeAbc), sourceFile_(sourceFile), emitter_(std::make_unique(this)), + recordName_(recordName) { } diff --git a/es2panda/compiler/core/compilerContext.h b/es2panda/compiler/core/compilerContext.h index 6acc7b83fb..5348d48fd3 100644 --- a/es2panda/compiler/core/compilerContext.h +++ b/es2panda/compiler/core/compilerContext.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -35,7 +36,7 @@ class Emitter; class CompilerContext { public: CompilerContext(binder::Binder *binder, bool isDebug, bool isDebuggerEvaluateExpressionMode, - bool isMergeAbc, std::string sourceFile); + bool isMergeAbc, std::string sourceFile, util::StringView recordName); NO_COPY_SEMANTIC(CompilerContext); NO_MOVE_SEMANTIC(CompilerContext); ~CompilerContext() = default; @@ -96,6 +97,11 @@ public: return hotfixHelper_; } + util::StringView RecordName() const + { + return recordName_; + } + private: binder::Binder *binder_; int32_t literalBufferIdx_ {0}; @@ -106,6 +112,7 @@ private: std::string sourceFile_; std::unique_ptr emitter_; util::Hotfix *hotfixHelper_ {nullptr}; + util::StringView recordName_; }; } // namespace panda::es2panda::compiler diff --git a/es2panda/compiler/core/compilerImpl.cpp b/es2panda/compiler/core/compilerImpl.cpp index 5561346b97..368783be96 100644 --- a/es2panda/compiler/core/compilerImpl.cpp +++ b/es2panda/compiler/core/compilerImpl.cpp @@ -39,7 +39,7 @@ panda::pandasm::Program *CompilerImpl::Compile(parser::Program *program, const e const std::string &debugInfoSourceFile) { CompilerContext context(program->Binder(), options.isDebug, options.isDebuggerEvaluateExpressionMode, - options.mergeAbc, debugInfoSourceFile); + options.mergeAbc, debugInfoSourceFile, program->RecordName()); if (hotfixHelper_ != nullptr) { context.AddHotfixHelper(hotfixHelper_); diff --git a/es2panda/compiler/core/emitter/emitter.cpp b/es2panda/compiler/core/emitter/emitter.cpp index 7006d4478e..a438ad9515 100644 --- a/es2panda/compiler/core/emitter/emitter.cpp +++ b/es2panda/compiler/core/emitter/emitter.cpp @@ -57,6 +57,8 @@ FunctionEmitter::FunctionEmitter(ArenaAllocator *allocator, const PandaGen *pg) void FunctionEmitter::Generate(util::Hotfix *hotfixHelper) { + GenFunctionKind(); + GenIcSize(); GenFunctionInstructions(); GenVariablesDebugInfo(); GenSourceFileDebugInfo(); @@ -72,6 +74,16 @@ const ArenaSet &FunctionEmitter::Strings() const return pg_->Strings(); } +void FunctionEmitter::GenFunctionKind() +{ + func_->SetFunctionKind(static_cast(pg_->GetFunctionKind())); +} + +void FunctionEmitter::GenIcSize() +{ + func_->SetSlotsNum(pg_->GetCurrentSlot()); +} + void FunctionEmitter::GenBufferLiterals(const LiteralBuffer *buff) { auto &[idx, array] = literalBuffers_.emplace_back(); diff --git a/es2panda/compiler/core/emitter/emitter.h b/es2panda/compiler/core/emitter/emitter.h index f689a4e57c..3bf135f729 100644 --- a/es2panda/compiler/core/emitter/emitter.h +++ b/es2panda/compiler/core/emitter/emitter.h @@ -81,6 +81,8 @@ private: void GenScopeVariableInfo(const binder::Scope *scope); void GenSourceFileDebugInfo(); void GenVariablesDebugInfo(); + void GenFunctionKind(); + void GenIcSize(); util::StringView SourceCode() const; lexer::LineIndex &GetLineIndex() const; diff --git a/es2panda/compiler/core/envScope.cpp b/es2panda/compiler/core/envScope.cpp index a6c123937c..6cb007c87e 100644 --- a/es2panda/compiler/core/envScope.cpp +++ b/es2panda/compiler/core/envScope.cpp @@ -30,11 +30,10 @@ ScopeContext::~ScopeContext() pg_->scope_ = prevScope_; } -void EnvScope::Initialize(PandaGen *pg, VReg lexEnv) +void EnvScope::Initialize(PandaGen *pg) { pg_ = pg; prev_ = pg_->envScope_; - lexEnv_ = lexEnv; pg_->envScope_ = this; } @@ -53,10 +52,9 @@ void LoopEnvScope::CopyBindings(PandaGen *pg, binder::VariableScope *scope, bind return; } - Initialize(pg, pg->AllocReg()); + Initialize(pg); pg_->NewLexicalEnv(scope_->Node(), scope->LexicalSlots(), scope_); - pg_->StoreAccumulator(scope_->Node(), lexEnv_); ASSERT(scope->NeedLexEnv()); @@ -89,7 +87,6 @@ void LoopEnvScope::CopyPetIterationCtx() } pg_->PopLexEnv(scope_->Node()); pg_->NewLexicalEnv(scope_->Node(), num, scope_); - pg_->StoreAccumulator(scope_->Node(), lexEnv_); for (uint32_t i = 0; i < num; i++) { pg_->StoreLexicalVar(scope_->Node(), 0, i, lexicals[i]); diff --git a/es2panda/compiler/core/envScope.h b/es2panda/compiler/core/envScope.h index 55b801a7a1..a21c2a3e52 100644 --- a/es2panda/compiler/core/envScope.h +++ b/es2panda/compiler/core/envScope.h @@ -52,12 +52,7 @@ public: NO_MOVE_SEMANTIC(EnvScope); ~EnvScope(); - void Initialize(PandaGen *pg, VReg lexEnv); - - VReg LexEnv() const - { - return lexEnv_; - } + void Initialize(PandaGen *pg); EnvScope *Prev() const { @@ -69,7 +64,6 @@ protected: PandaGen *pg_ {}; EnvScope *prev_ {}; - VReg lexEnv_ {}; }; class LoopEnvScope : public EnvScope { diff --git a/es2panda/compiler/core/function.cpp b/es2panda/compiler/core/function.cpp index 939d1740ac..c2f0f7298e 100644 --- a/es2panda/compiler/core/function.cpp +++ b/es2panda/compiler/core/function.cpp @@ -170,7 +170,7 @@ static void CompileFunction(PandaGen *pg) pg->FunctionExit(); } -static VReg CompileFunctionOrProgram(PandaGen *pg) +static void CompileFunctionOrProgram(PandaGen *pg) { FunctionRegScope lrs(pg); const auto *topScope = pg->TopScope(); @@ -192,16 +192,15 @@ static VReg CompileFunctionOrProgram(PandaGen *pg) CompileSourceBlock(pg, pg->RootNode()->AsBlockStatement()); } } - - return pg->GetEnvScope()->LexEnv(); } void Function::Compile(PandaGen *pg) { - VReg lexEnv = CompileFunctionOrProgram(pg); + CompileFunctionOrProgram(pg); + pg->SetFunctionKind(); pg->SetSourceLocationFlag(lexer::SourceLocationFlag::INVALID_SOURCE_LOCATION); pg->CopyFunctionArguments(pg->RootNode()); - pg->InitializeLexEnv(pg->RootNode(), lexEnv); + pg->InitializeLexEnv(pg->RootNode()); pg->SetSourceLocationFlag(lexer::SourceLocationFlag::VALID_SOURCE_LOCATION); pg->SortCatchTables(); } diff --git a/es2panda/compiler/core/pandagen.cpp b/es2panda/compiler/core/pandagen.cpp index ef06720971..3d3072ab92 100644 --- a/es2panda/compiler/core/pandagen.cpp +++ b/es2panda/compiler/core/pandagen.cpp @@ -42,11 +42,52 @@ #include #include #include +#include namespace panda::es2panda::compiler { // PandaGen +void PandaGen::SetFunctionKind() +{ + if (rootNode_->IsProgram()) { + funcKind_ = FunctionKind::FUNCTION; + return; + } + + auto *func = rootNode_->AsScriptFunction(); + if (func->IsMethod()) { + return; + } + + if (func->IsAsync()) { + if (func->IsGenerator()) { + funcKind_ = FunctionKind::ASYNC_GENERATOR_FUNCTION; + return; + } + + if (func->IsArrow()) { + funcKind_ = FunctionKind::ASYNC_NCFUNCTION; + return; + } + + funcKind_ = FunctionKind::ASYNC_FUNCTION; + return; + } + + if (func->IsGenerator()) { + funcKind_ = FunctionKind::GENERATOR_FUNCTION; + return; + } + + if (func->IsArrow()) { + funcKind_ = FunctionKind::NC_FUNCTION; + return; + } + + funcKind_ = FunctionKind::FUNCTION; +} + Label *PandaGen::AllocLabel() { std::string id = std::string {Label::PREFIX} + std::to_string(labelId_++); @@ -157,17 +198,13 @@ void PandaGen::FunctionExit() builder_->CleanUp(rootNode_->AsScriptFunction()); } -void PandaGen::InitializeLexEnv(const ir::AstNode *node, VReg lexEnv) +void PandaGen::InitializeLexEnv(const ir::AstNode *node) { FrontAllocator fa(this); if (topScope_->NeedLexEnv()) { NewLexicalEnv(node, topScope_->LexicalSlots(), topScope_); - } else { - LdLexEnv(node); } - - StoreAccumulator(node, lexEnv); } void PandaGen::CopyFunctionArguments(const ir::AstNode *node) @@ -179,7 +216,7 @@ void PandaGen::CopyFunctionArguments(const ir::AstNode *node) if (param->LexicalBound()) { StoreLexicalVar(node, 0, param->LexIdx(), targetReg++); } else { - ra_.Emit(node, param->Vreg(), targetReg++); + MoveVreg(node, param->Vreg(), targetReg++); } } } @@ -242,7 +279,8 @@ void PandaGen::LoadVar(const ir::Identifier *node, const binder::ScopeFindResult } if (var->IsModuleVariable()) { - LoadModuleVariable(node, var->Name(), var->HasFlag(binder::VariableFlags::LOCAL_EXPORT)); + var->HasFlag(binder::VariableFlags::LOCAL_EXPORT) ? LoadLocalModuleVariable(node, var->AsModuleVariable()) : + LoadExternalModuleVariable(node, var->AsModuleVariable()); if (var->Declaration()->IsLetOrConstOrClassDecl()) { ThrowUndefinedIfHole(node, var->Name()); } @@ -284,12 +322,12 @@ void PandaGen::StoreVar(const ir::AstNode *node, const binder::ScopeFindResult & RegScope rs(this); VReg valueReg = AllocReg(); StoreAccumulator(node, valueReg); - LoadModuleVariable(node, var->Name(), true); + LoadLocalModuleVariable(node, var->AsModuleVariable()); ThrowUndefinedIfHole(node, var->Name()); LoadAccumulator(node, valueReg); } - StoreModuleVariable(node, var->Name()); + StoreModuleVariable(node, var->AsModuleVariable()); return; } @@ -298,13 +336,12 @@ void PandaGen::StoreVar(const ir::AstNode *node, const binder::ScopeFindResult & if (var->Declaration()->IsLetOrConstOrClassDecl() && result.scope->IsGlobalScope()) { if (!isDeclaration) { TryStoreGlobalByName(node, var->Name()); - } else if (var->Declaration()->IsLetDecl()) { - StLetToGlobalRecord(node, var->Name()); + } else if (var->Declaration()->IsLetDecl() || var->Declaration()->IsClassDecl()) { + StLetOrClassToGlobalRecord(node, var->Name()); } else if (var->Declaration()->IsConstDecl()) { StConstToGlobalRecord(node, var->Name()); - } else if (var->Declaration()->IsClassDecl()) { - StClassToGlobalRecord(node, var->Name()); } + return; } @@ -313,7 +350,7 @@ void PandaGen::StoreVar(const ir::AstNode *node, const binder::ScopeFindResult & void PandaGen::StoreAccumulator(const ir::AstNode *node, VReg vreg) { - ra_.Emit(node, vreg); + ra_.Emit(node, vreg); } void PandaGen::LoadAccFromArgs(const ir::AstNode *node) @@ -334,7 +371,8 @@ void PandaGen::LoadAccFromArgs(const ir::AstNode *node) void PandaGen::LoadObjProperty(const ir::AstNode *node, VReg obj, const Operand &prop) { if (std::holds_alternative(prop)) { - LoadObjByValue(node, obj, std::get(prop)); + LoadAccumulator(node, std::get(prop)); + LoadObjByValue(node, obj); return; } @@ -409,7 +447,8 @@ void PandaGen::TryLoadGlobalByName(const ir::AstNode *node, const util::StringVi if (isDebuggerEvaluateExpressionMode()) { LoadObjByNameViaDebugger(node, name, true); } else { - sa_.Emit(node, name); + // modify ic later + sa_.Emit(node, 0, name); } strings_.insert(name); } @@ -437,109 +476,121 @@ void PandaGen::TryStoreGlobalByName(const ir::AstNode *node, const util::StringV if (isDebuggerEvaluateExpressionMode()) { StoreObjByNameViaDebugger(node, name); } else { - sa_.Emit(node, name); + // modify ic later + sa_.Emit(node, 0, name); } strings_.insert(name); } void PandaGen::LoadObjByName(const ir::AstNode *node, VReg obj, const util::StringView &prop) { - ra_.Emit(node, prop, obj); + // modify ic later + LoadAccumulator(node, obj); // object is load to acc + sa_.Emit(node, 0, prop); strings_.insert(prop); } void PandaGen::StoreObjByName(const ir::AstNode *node, VReg obj, const util::StringView &prop) { - ra_.Emit(node, prop, obj); + // modify ic later + ra_.Emit(node, 0, prop, obj); strings_.insert(prop); } void PandaGen::LoadObjByIndex(const ir::AstNode *node, VReg obj, int64_t index) { - ra_.Emit(node, index, obj); + LoadAccumulator(node, obj); // object is load to acc + if (index <= util::Helpers::MAX_INT16) { + // modify ic later + sa_.Emit(node, 0, index); + return; + } + + sa_.Emit(node, index); } -void PandaGen::LoadObjByValue(const ir::AstNode *node, VReg obj, VReg prop) +void PandaGen::LoadObjByValue(const ir::AstNode *node, VReg obj) { - ra_.Emit(node, obj, prop); + // modify ic later + ra_.Emit(node, 0, obj); // prop is in acc } void PandaGen::StoreObjByValue(const ir::AstNode *node, VReg obj, VReg prop) { - ra_.Emit(node, obj, prop); + // modify ic later + ra_.Emit(node, 0, obj, prop); } void PandaGen::StoreObjByIndex(const ir::AstNode *node, VReg obj, int64_t index) { - ra_.Emit(node, index, obj); + if (index <= util::Helpers::MAX_INT16) { + // modify ic later + ra_.Emit(node, 0, obj, index); + return; + } + + ra_.Emit(node, obj, index); } void PandaGen::StOwnByName(const ir::AstNode *node, VReg obj, const util::StringView &prop, bool nameSetting) { - nameSetting ? ra_.Emit(node, prop, obj) : - ra_.Emit(node, prop, obj); + // modify ic later + nameSetting ? ra_.Emit(node, 0, prop, obj) : + ra_.Emit(node, 0, prop, obj); strings_.insert(prop); } void PandaGen::StOwnByValue(const ir::AstNode *node, VReg obj, VReg prop, bool nameSetting) { - nameSetting ? ra_.Emit(node, obj, prop) : - ra_.Emit(node, obj, prop); + // modify ic later + nameSetting ? ra_.Emit(node, 0, obj, prop) : + ra_.Emit(node, 0, obj, prop); } void PandaGen::StOwnByIndex(const ir::AstNode *node, VReg obj, int64_t index) { - ra_.Emit(node, obj, index); + if (index <= util::Helpers::MAX_INT16) { + // modify ic later + ra_.Emit(node, 0, obj, index); + return; + } + + ra_.Emit(node, obj, index); } void PandaGen::DeleteObjProperty(const ir::AstNode *node, VReg obj, const Operand &prop) { - VReg property {}; - if (std::holds_alternative(prop)) { - property = std::get(prop); + LoadAccumulator(node, std::get(prop)); } else if (std::holds_alternative(prop)) { LoadAccumulatorInt(node, static_cast(std::get(prop))); - property = AllocReg(); - StoreAccumulator(node, property); } else { ASSERT(std::holds_alternative(prop)); LoadAccumulatorString(node, std::get(prop)); - property = AllocReg(); - StoreAccumulator(node, property); } - ra_.Emit(node, obj, property); + ra_.Emit(node, obj); // property is load to acc } void PandaGen::LoadAccumulator(const ir::AstNode *node, VReg reg) { - ra_.Emit(node, reg); + ra_.Emit(node, reg); } void PandaGen::LoadGlobalVar(const ir::AstNode *node, const util::StringView &name) { - sa_.Emit(node, name); + // modify ic later + sa_.Emit(node, 0, name); strings_.insert(name); } void PandaGen::StoreGlobalVar(const ir::AstNode *node, const util::StringView &name) { - sa_.Emit(node, name); - strings_.insert(name); -} - -void PandaGen::StoreGlobalLet(const ir::AstNode *node, const util::StringView &name) -{ - sa_.Emit(node, name); + // modify ic later + sa_.Emit(node, 0, name); strings_.insert(name); } -VReg PandaGen::LexEnv() const -{ - return envScope_->LexEnv(); -} - void PandaGen::LoadAccFromLexEnv(const ir::AstNode *node, const binder::ScopeFindResult &result) { VirtualLoadVar::Expand(this, node, result); @@ -558,22 +609,22 @@ void PandaGen::LoadAccumulatorString(const ir::AstNode *node, const util::String void PandaGen::LoadAccumulatorFloat(const ir::AstNode *node, double num) { - sa_.Emit(node, num); + sa_.Emit(node, num); } void PandaGen::LoadAccumulatorInt(const ir::AstNode *node, int32_t num) { - sa_.Emit(node, num); + sa_.Emit(node, num); } void PandaGen::LoadAccumulatorInt(const ir::AstNode *node, size_t num) { - sa_.Emit(node, static_cast(num)); + sa_.Emit(node, static_cast(num)); } void PandaGen::LoadAccumulatorBigInt(const ir::AstNode *node, const util::StringView &num) { - sa_.Emit(node, num); + sa_.Emit(node, num); strings_.insert(num); } @@ -587,39 +638,39 @@ void PandaGen::LoadConst(const ir::AstNode *node, Constant id) { switch (id) { case Constant::JS_HOLE: { - sa_.Emit(node); + sa_.Emit(node); break; } case Constant::JS_NAN: { - sa_.Emit(node); + sa_.Emit(node); break; } case Constant::JS_INFINITY: { - sa_.Emit(node); + sa_.Emit(node); break; } case Constant::JS_GLOBAL: { - sa_.Emit(node); + sa_.Emit(node); break; } case Constant::JS_UNDEFINED: { - sa_.Emit(node); + sa_.Emit(node); break; } case Constant::JS_SYMBOL: { - sa_.Emit(node); + sa_.Emit(node); break; } case Constant::JS_NULL: { - sa_.Emit(node); + sa_.Emit(node); break; } case Constant::JS_TRUE: { - sa_.Emit(node); + sa_.Emit(node); break; } case Constant::JS_FALSE: { - sa_.Emit(node); + sa_.Emit(node); break; } default: { @@ -630,7 +681,7 @@ void PandaGen::LoadConst(const ir::AstNode *node, Constant id) void PandaGen::MoveVreg(const ir::AstNode *node, VReg vd, VReg vs) { - ra_.Emit(node, vd, vs); + ra_.Emit(node, vd, vs); } void PandaGen::SetLabel([[maybe_unused]] const ir::AstNode *node, Label *label) @@ -713,35 +764,35 @@ void PandaGen::Condition(const ir::AstNode *node, lexer::TokenType op, VReg lhs, { switch (op) { case lexer::TokenType::PUNCTUATOR_EQUAL: { - ra_.Emit(node, lhs); + Equal(node, lhs); break; } case lexer::TokenType::PUNCTUATOR_NOT_EQUAL: { - ra_.Emit(node, lhs); + NotEqual(node, lhs); break; } case lexer::TokenType::PUNCTUATOR_STRICT_EQUAL: { - ra_.Emit(node, lhs); + StrictEqual(node, lhs); break; } case lexer::TokenType::PUNCTUATOR_NOT_STRICT_EQUAL: { - ra_.Emit(node, lhs); + StrictNotEqual(node, lhs); break; } case lexer::TokenType::PUNCTUATOR_LESS_THAN: { - ra_.Emit(node, lhs); + LessThan(node, lhs); break; } case lexer::TokenType::PUNCTUATOR_LESS_THAN_EQUAL: { - ra_.Emit(node, lhs); + LessEqual(node, lhs); break; } case lexer::TokenType::PUNCTUATOR_GREATER_THAN: { - ra_.Emit(node, lhs); + GreaterThan(node, lhs); break; } case lexer::TokenType::PUNCTUATOR_GREATER_THAN_EQUAL: { - ra_.Emit(node, lhs); + GreaterEqual(node, lhs); break; } default: { @@ -756,15 +807,17 @@ void PandaGen::Unary(const ir::AstNode *node, lexer::TokenType op, VReg operand) { switch (op) { case lexer::TokenType::PUNCTUATOR_PLUS: { - ra_.Emit(node, operand); + ToNumber(node, operand); break; } case lexer::TokenType::PUNCTUATOR_MINUS: { - ra_.Emit(node, operand); + LoadAccumulator(node, operand); + sa_.Emit(node, 0); break; } case lexer::TokenType::PUNCTUATOR_TILDE: { - ra_.Emit(node, operand); + LoadAccumulator(node, operand); + sa_.Emit(node, 0); break; } case lexer::TokenType::PUNCTUATOR_EXCLAMATION_MARK: { @@ -772,11 +825,13 @@ void PandaGen::Unary(const ir::AstNode *node, lexer::TokenType op, VReg operand) break; } case lexer::TokenType::PUNCTUATOR_PLUS_PLUS: { - ra_.Emit(node, operand); + LoadAccumulator(node, operand); + sa_.Emit(node, 0); break; } case lexer::TokenType::PUNCTUATOR_MINUS_MINUS: { - ra_.Emit(node, operand); + LoadAccumulator(node, operand); + sa_.Emit(node, 0); break; } case lexer::TokenType::KEYW_VOID: @@ -792,105 +847,106 @@ void PandaGen::Unary(const ir::AstNode *node, lexer::TokenType op, VReg operand) void PandaGen::Binary(const ir::AstNode *node, lexer::TokenType op, VReg lhs) { + // modify ic later switch (op) { case lexer::TokenType::PUNCTUATOR_EQUAL: { - ra_.Emit(node, lhs); + Equal(node, lhs); break; } case lexer::TokenType::PUNCTUATOR_NOT_EQUAL: { - ra_.Emit(node, lhs); + NotEqual(node, lhs); break; } case lexer::TokenType::PUNCTUATOR_STRICT_EQUAL: { - ra_.Emit(node, lhs); + StrictEqual(node, lhs); break; } case lexer::TokenType::PUNCTUATOR_NOT_STRICT_EQUAL: { - ra_.Emit(node, lhs); + StrictNotEqual(node, lhs); break; } case lexer::TokenType::PUNCTUATOR_LESS_THAN: { - ra_.Emit(node, lhs); + LessThan(node, lhs); break; } case lexer::TokenType::PUNCTUATOR_LESS_THAN_EQUAL: { - ra_.Emit(node, lhs); + LessEqual(node, lhs); break; } case lexer::TokenType::PUNCTUATOR_GREATER_THAN: { - ra_.Emit(node, lhs); + GreaterThan(node, lhs); break; } case lexer::TokenType::PUNCTUATOR_GREATER_THAN_EQUAL: { - ra_.Emit(node, lhs); + GreaterEqual(node, lhs); break; } case lexer::TokenType::PUNCTUATOR_PLUS: case lexer::TokenType::PUNCTUATOR_PLUS_EQUAL: { - ra_.Emit(node, lhs); + ra_.Emit(node, 0, lhs); break; } case lexer::TokenType::PUNCTUATOR_MINUS: case lexer::TokenType::PUNCTUATOR_MINUS_EQUAL: { - ra_.Emit(node, lhs); + ra_.Emit(node, 0, lhs); break; } case lexer::TokenType::PUNCTUATOR_MULTIPLY: case lexer::TokenType::PUNCTUATOR_MULTIPLY_EQUAL: { - ra_.Emit(node, lhs); + ra_.Emit(node, 0, lhs); break; } case lexer::TokenType::PUNCTUATOR_DIVIDE: case lexer::TokenType::PUNCTUATOR_DIVIDE_EQUAL: { - ra_.Emit(node, lhs); + ra_.Emit(node, 0, lhs); break; } case lexer::TokenType::PUNCTUATOR_MOD: case lexer::TokenType::PUNCTUATOR_MOD_EQUAL: { - ra_.Emit(node, lhs); + ra_.Emit(node, 0, lhs); break; } case lexer::TokenType::PUNCTUATOR_EXPONENTIATION_EQUAL: case lexer::TokenType::PUNCTUATOR_EXPONENTIATION: { - ra_.Emit(node, lhs); + ra_.Emit(node, 0, lhs); break; } case lexer::TokenType::PUNCTUATOR_LEFT_SHIFT: case lexer::TokenType::PUNCTUATOR_LEFT_SHIFT_EQUAL: { - ra_.Emit(node, lhs); + ra_.Emit(node, 0, lhs); break; } case lexer::TokenType::PUNCTUATOR_RIGHT_SHIFT: case lexer::TokenType::PUNCTUATOR_RIGHT_SHIFT_EQUAL: { - ra_.Emit(node, lhs); + ra_.Emit(node, 0, lhs); break; } case lexer::TokenType::PUNCTUATOR_UNSIGNED_RIGHT_SHIFT: case lexer::TokenType::PUNCTUATOR_UNSIGNED_RIGHT_SHIFT_EQUAL: { - ra_.Emit(node, lhs); + ra_.Emit(node, 0, lhs); break; } case lexer::TokenType::PUNCTUATOR_BITWISE_AND: case lexer::TokenType::PUNCTUATOR_BITWISE_AND_EQUAL: { - ra_.Emit(node, lhs); + ra_.Emit(node, 0, lhs); break; } case lexer::TokenType::PUNCTUATOR_BITWISE_OR: case lexer::TokenType::PUNCTUATOR_BITWISE_OR_EQUAL: { - ra_.Emit(node, lhs); + ra_.Emit(node, 0, lhs); break; } case lexer::TokenType::PUNCTUATOR_BITWISE_XOR: case lexer::TokenType::PUNCTUATOR_BITWISE_XOR_EQUAL: { - ra_.Emit(node, lhs); + ra_.Emit(node, 0, lhs); break; } case lexer::TokenType::KEYW_IN: { - ra_.Emit(node, lhs); + ra_.Emit(node, 0, lhs); break; } case lexer::TokenType::KEYW_INSTANCEOF: { - ra_.Emit(node, lhs); + ra_.Emit(node, 0, lhs); break; } case lexer::TokenType::PUNCTUATOR_NULLISH_COALESCING: @@ -904,13 +960,66 @@ void PandaGen::Binary(const ir::AstNode *node, lexer::TokenType op, VReg lhs) } } +void PandaGen::Equal(const ir::AstNode *node, VReg lhs) +{ + // modify ic later + ra_.Emit(node, 0, lhs); +} + +void PandaGen::NotEqual(const ir::AstNode *node, VReg lhs) +{ + // modify ic later + ra_.Emit(node, 0, lhs); +} + +void PandaGen::StrictEqual(const ir::AstNode *node, VReg lhs) +{ + // modify ic later + ra_.Emit(node, 0, lhs); +} + +void PandaGen::StrictNotEqual(const ir::AstNode *node, VReg lhs) +{ + // modify ic later + ra_.Emit(node, 0, lhs); +} + +void PandaGen::LessThan(const ir::AstNode *node, VReg lhs) +{ + // modify ic later + ra_.Emit(node, 0, lhs); +} + +void PandaGen::LessEqual(const ir::AstNode *node, VReg lhs) +{ + // modify ic later + ra_.Emit(node, 0, lhs); +} + +void PandaGen::GreaterThan(const ir::AstNode *node, VReg lhs) +{ + // modify ic later + ra_.Emit(node, 0, lhs); +} + +void PandaGen::GreaterEqual(const ir::AstNode *node, VReg lhs) +{ + // modify ic later + ra_.Emit(node, 0, lhs); +} + +void PandaGen::IsTrue(const ir::AstNode *node) +{ + sa_.Emit(node); +} + void PandaGen::BranchIfUndefined(const ir::AstNode *node, Label *target) { RegScope rs(this); VReg tmp = AllocReg(); StoreAccumulator(node, tmp); - sa_.Emit(node); - ra_.Emit(node, tmp); + LoadConst(node, Constant::JS_UNDEFINED); + Equal(node, tmp); sa_.Emit(node, target); } @@ -919,8 +1028,8 @@ void PandaGen::BranchIfNotUndefined(const ir::AstNode *node, Label *target) RegScope rs(this); VReg tmp = AllocReg(); StoreAccumulator(node, tmp); - sa_.Emit(node); - ra_.Emit(node, tmp); + LoadConst(node, Constant::JS_UNDEFINED); + Equal(node, tmp); sa_.Emit(node, target); } @@ -930,31 +1039,31 @@ void PandaGen::BranchIfStrictNotUndefined(const ir::AstNode *node, class Label * VReg tmp = AllocReg(); StoreAccumulator(node, tmp); LoadConst(node, Constant::JS_UNDEFINED); - ra_.Emit(node, tmp); + StrictEqual(node, tmp); sa_.Emit(node, target); } void PandaGen::BranchIfTrue(const ir::AstNode *node, Label *target) { - sa_.Emit(node); + IsTrue(node); sa_.Emit(node, target); } void PandaGen::BranchIfNotTrue(const ir::AstNode *node, Label *target) { - sa_.Emit(node); + IsTrue(node); BranchIfFalse(node, target); } void PandaGen::BranchIfFalse(const ir::AstNode *node, Label *target) { - sa_.Emit(node); + sa_.Emit(node); sa_.Emit(node, target); } void PandaGen::EmitThrow(const ir::AstNode *node) { - sa_.Emit(node); + sa_.Emit(node); } void PandaGen::EmitRethrow(const ir::AstNode *node) @@ -970,24 +1079,24 @@ void PandaGen::EmitRethrow(const ir::AstNode *node) StoreConst(node, hole, Constant::JS_HOLE); LoadAccumulator(node, exception); - ra_.Emit(node, hole); + NotEqual(node, hole); sa_.Emit(node, skipThrow); SetLabel(node, doThrow); LoadAccumulator(node, exception); - sa_.Emit(node); + EmitThrow(node); SetLabel(node, skipThrow); } void PandaGen::EmitReturn(const ir::AstNode *node) { - sa_.Emit(node); + sa_.Emit(node); } void PandaGen::EmitReturnUndefined(const ir::AstNode *node) { - sa_.Emit(node); + sa_.Emit(node); } void PandaGen::ImplicitReturn(const ir::AstNode *node) @@ -1033,38 +1142,80 @@ void PandaGen::EmitAwait(const ir::AstNode *node) void PandaGen::CallThis(const ir::AstNode *node, VReg startReg, size_t argCount) { - rra_.Emit(node, startReg, argCount + 2, static_cast(argCount), startReg); + // modify ic later + LoadAccumulator(node, startReg); // callee is load to acc + VReg thisReg = startReg + 1; + switch (argCount) { + case 1: { // no args + ra_.Emit(node, 0, thisReg); + break; + } + case 2: { // 1 arg + VReg arg0 = thisReg + 1; + ra_.Emit(node, 0, thisReg, arg0); + break; + } + case 3: { // 2 args + VReg arg0 = thisReg + 1; + VReg arg1 = arg0 + 1; + ra_.Emit(node, 0, thisReg , arg0, arg1); + break; + } + case 4: { // 3 args + VReg arg0 = thisReg + 1; + VReg arg1 = arg0 + 1; + VReg arg2 = arg1 + 1; + ra_.Emit(node, 0, thisReg , arg0, arg1, arg2); + break; + } + default: { + int64_t actualArgs = argCount - 1; + if (actualArgs <= util::Helpers::MAX_INT8) { + rra_.Emit(node, thisReg, argCount + 1, 0, actualArgs, thisReg); + break; + } + + rra_.Emit(node, thisReg, argCount + 1, actualArgs, thisReg); + break; + } + } } void PandaGen::Call(const ir::AstNode *node, VReg startReg, size_t argCount) { - VReg callee = startReg; - + LoadAccumulator(node, startReg); // callee is load to acc + // modify ic later switch (argCount) { case 0: { // 0 args - ra_.Emit(node, callee); + sa_.Emit(node, 0); break; } case 1: { // 1 arg - VReg arg0 = callee + 1; - ra_.Emit(node, callee, arg0); + VReg arg0 = startReg + 1; + ra_.Emit(node, 0, arg0); break; } case 2: { // 2 args - VReg arg0 = callee + 1; + VReg arg0 = startReg + 1; VReg arg1 = arg0 + 1; - ra_.Emit(node, callee, arg0, arg1); + ra_.Emit(node, 0, arg0, arg1); break; } case 3: { // 3 args - VReg arg0 = callee + 1; + VReg arg0 = startReg + 1; VReg arg1 = arg0 + 1; VReg arg2 = arg1 + 1; - ra_.Emit(node, callee, arg0, arg1, arg2); + ra_.Emit(node, 0, arg0, arg1, arg2); break; } default: { - rra_.Emit(node, startReg, argCount + 1, static_cast(argCount), startReg); + VReg arg0 = startReg + 1; + if (argCount <= util::Helpers::MAX_INT8) { + rra_.Emit(node, arg0, argCount, 0, argCount, arg0); + break; + } + + rra_.Emit(node, arg0, argCount, argCount, arg0); break; } } @@ -1072,22 +1223,41 @@ void PandaGen::Call(const ir::AstNode *node, VReg startReg, size_t argCount) void PandaGen::SuperCall(const ir::AstNode *node, VReg startReg, size_t argCount) { - rra_.Emit(node, startReg, argCount, static_cast(argCount), startReg); + // modify ic later + if (RootNode()->AsScriptFunction()->IsArrow()) { + GetFunctionObject(node); // load funcobj to acc for super call in arrow function + if (argCount <= util::Helpers::MAX_INT8) { + rra_.Emit(node, startReg, argCount, 0, static_cast(argCount), startReg); + } else { + rra_.Emit(node, startReg, argCount, static_cast(argCount), startReg); + } + return; + } + + if (argCount <= util::Helpers::MAX_INT8) { + // no need to load funcobj to acc for super call in other kinds of functions + rra_.Emit(node, startReg, argCount, 0, static_cast(argCount), startReg); + return; + } + + rra_.Emit(node, startReg, argCount, static_cast(argCount), startReg); } void PandaGen::SuperCallSpread(const ir::AstNode *node, VReg vs) { - ra_.Emit(node, vs); + // modify ic later + ra_.Emit(node, 0, vs); } void PandaGen::NewObject(const ir::AstNode *node, VReg startReg, size_t argCount) { - rra_.Emit(node, startReg, argCount, static_cast(argCount), startReg); -} + if (argCount <= util::Helpers::MAX_INT8) { + // modify ic later + rra_.Emit(node, startReg, argCount, 0, static_cast(argCount), startReg); + return; + } -void PandaGen::LoadHomeObject(const ir::AstNode *node) -{ - sa_.Emit(node); + rra_.Emit(node, startReg, argCount, static_cast(argCount), startReg); } void PandaGen::DefineFunction(const ir::AstNode *node, const ir::ScriptFunction *realNode, const util::StringView &name) @@ -1096,22 +1266,12 @@ void PandaGen::DefineFunction(const ir::AstNode *node, const ir::ScriptFunction return; } + // modify ic later auto formalParamCnt = realNode->FormalParamsLength(); if (realNode->IsMethod()) { - ra_.Emit(node, name, static_cast(formalParamCnt), LexEnv()); - } else if (realNode->IsAsync()) { - if (realNode->IsGenerator()) { - ra_.Emit(node, name, static_cast(formalParamCnt), LexEnv()); - } else { - ra_.Emit(node, name, static_cast(formalParamCnt), LexEnv()); - } - } else if (realNode->IsGenerator()) { - ra_.Emit(node, name, static_cast(formalParamCnt), LexEnv()); - } else if (realNode->IsArrow()) { - LoadHomeObject(node); - ra_.Emit(node, name, static_cast(formalParamCnt), LexEnv()); - } else { - ra_.Emit(node, name, static_cast(formalParamCnt), LexEnv()); + ra_.Emit(node, 0, name, static_cast(formalParamCnt)); + } else { + ra_.Emit(node, 0, name, static_cast(formalParamCnt)); } strings_.insert(name); @@ -1119,22 +1279,26 @@ void PandaGen::DefineFunction(const ir::AstNode *node, const ir::ScriptFunction void PandaGen::TypeOf(const ir::AstNode *node) { - sa_.Emit(node); + // modify ic later + sa_.Emit(node, 0); } void PandaGen::CallSpread(const ir::AstNode *node, VReg func, VReg thisReg, VReg args) { - ra_.Emit(node, func, thisReg, args); + // modify ic later + LoadAccumulator(node, func); // callee is load to acc + ra_.Emit(node, 0, thisReg, args); } -void PandaGen::NewObjSpread(const ir::AstNode *node, VReg obj, VReg target) +void PandaGen::NewObjSpread(const ir::AstNode *node, VReg obj) { - ra_.Emit(node, obj, target); + // modify ic later + ra_.Emit(node, 0, obj); } void PandaGen::GetUnmappedArgs(const ir::AstNode *node) { - sa_.Emit(node); + sa_.Emit(node); } void PandaGen::Negate(const ir::AstNode *node) @@ -1151,32 +1315,36 @@ void PandaGen::Negate(const ir::AstNode *node) void PandaGen::ToNumber(const ir::AstNode *node, VReg arg) { - ra_.Emit(node, arg); + // modify ic later + LoadAccumulator(node, arg); + sa_.Emit(node, 0); } void PandaGen::ToNumeric(const ir::AstNode *node, VReg arg) { - ra_.Emit(node, arg); + // modify ic later + LoadAccumulator(node, arg); + sa_.Emit(node, 0); } void PandaGen::CreateGeneratorObj(const ir::AstNode *node, VReg funcObj) { - ra_.Emit(node, funcObj); + ra_.Emit(node, funcObj); } void PandaGen::CreateAsyncGeneratorObj(const ir::AstNode *node, VReg funcObj) { - ra_.Emit(node, funcObj); + ra_.Emit(node, funcObj); } void PandaGen::CreateIterResultObject(const ir::AstNode *node, VReg value, VReg done) { - ra_.Emit(node, value, done); + ra_.Emit(node, value, done); } -void PandaGen::SuspendGenerator(const ir::AstNode *node, VReg genObj, VReg iterResult) +void PandaGen::SuspendGenerator(const ir::AstNode *node, VReg genObj) { - ra_.Emit(node, genObj, iterResult); + ra_.Emit(node, genObj); // iterResult is in acc } void PandaGen::SuspendAsyncGenerator(const ir::AstNode *node, VReg asyncGenObj) @@ -1205,37 +1373,39 @@ void PandaGen::GeneratorComplete(const ir::AstNode *node, VReg genObj) void PandaGen::ResumeGenerator(const ir::AstNode *node, VReg genObj) { - ra_.Emit(node, genObj); + LoadAccumulator(node, genObj); + sa_.Emit(node); } void PandaGen::GetResumeMode(const ir::AstNode *node, VReg genObj) { - ra_.Emit(node, genObj); + LoadAccumulator(node, genObj); + sa_.Emit(node); } void PandaGen::AsyncFunctionEnter(const ir::AstNode *node) { - sa_.Emit(node); + sa_.Emit(node); } -void PandaGen::AsyncFunctionAwait(const ir::AstNode *node, VReg asyncFuncObj, VReg retVal) +void PandaGen::AsyncFunctionAwait(const ir::AstNode *node, VReg asyncFuncObj) { - ra_.Emit(node, asyncFuncObj, retVal); + ra_.Emit(node, asyncFuncObj); // receivedValue is in acc } -void PandaGen::AsyncFunctionResolve(const ir::AstNode *node, VReg asyncFuncObj, VReg value, VReg canSuspend) +void PandaGen::AsyncFunctionResolve(const ir::AstNode *node, VReg asyncFuncObj) { - ra_.Emit(node, asyncFuncObj, canSuspend, value); + ra_.Emit(node, asyncFuncObj); // use retVal in acc } -void PandaGen::AsyncFunctionReject(const ir::AstNode *node, VReg asyncFuncObj, VReg value, VReg canSuspend) +void PandaGen::AsyncFunctionReject(const ir::AstNode *node, VReg asyncFuncObj) { - ra_.Emit(node, asyncFuncObj, canSuspend, value); + ra_.Emit(node, asyncFuncObj); // exception is in acc } void PandaGen::AsyncGeneratorResolve(const ir::AstNode *node, VReg asyncGenObj, VReg value, VReg canSuspend) { - ra_.Emit(node, asyncGenObj, value, canSuspend); + ra_.Emit(node, asyncGenObj, value, canSuspend); } void PandaGen::AsyncGeneratorReject(const ir::AstNode *node, VReg asyncGenObj, VReg value) @@ -1245,68 +1415,69 @@ void PandaGen::AsyncGeneratorReject(const ir::AstNode *node, VReg asyncGenObj, V void PandaGen::GetTemplateObject(const ir::AstNode *node, VReg value) { - ra_.Emit(node, value); + // modify ic later + LoadAccumulator(node, value); + sa_.Emit(node, 0); } void PandaGen::CopyRestArgs(const ir::AstNode *node, uint32_t index) { - sa_.Emit(node, index); + index <= util::Helpers::MAX_INT8 ? sa_.Emit(node, index) : sa_.Emit(node, index); } void PandaGen::GetPropIterator(const ir::AstNode *node) { - sa_.Emit(node); + sa_.Emit(node); } void PandaGen::GetNextPropName(const ir::AstNode *node, VReg iter) { - ra_.Emit(node, iter); + ra_.Emit(node, iter); } void PandaGen::CreateEmptyObject(const ir::AstNode *node) { - sa_.Emit(node); + sa_.Emit(node); } void PandaGen::CreateObjectWithBuffer(const ir::AstNode *node, uint32_t idx) { ASSERT(util::Helpers::IsInteger(idx)); - sa_.Emit(node, idx); -} - -void PandaGen::CreateObjectHavingMethod(const ir::AstNode *node, uint32_t idx) -{ - ASSERT(util::Helpers::IsInteger(idx)); - LoadAccumulator(node, LexEnv()); - sa_.Emit(node, idx); + std::string idxStr = std::string(context_->RecordName()) + std::to_string(idx); + util::UString litId(idxStr, allocator_); + sa_.Emit(node, 0, litId.View()); } void PandaGen::SetObjectWithProto(const ir::AstNode *node, VReg proto, VReg obj) { - ra_.Emit(node, proto, obj); + LoadAccumulator(node, obj); + ra_.Emit(node, 0, proto); } -void PandaGen::CopyDataProperties(const ir::AstNode *node, VReg dst, VReg src) +void PandaGen::CopyDataProperties(const ir::AstNode *node, VReg dst) { - ra_.Emit(node, dst, src); + ra_.Emit(node, dst); // use acc as srcObj } void PandaGen::DefineGetterSetterByValue(const ir::AstNode *node, VReg obj, VReg name, VReg getter, VReg setter, bool setName) { LoadConst(node, setName ? Constant::JS_TRUE : Constant::JS_FALSE); - ra_.Emit(node, obj, name, getter, setter); + ra_.Emit(node, obj, name, getter, setter); } void PandaGen::CreateEmptyArray(const ir::AstNode *node) { - sa_.Emit(node); + // modify ic later + sa_.Emit(node, 0); } void PandaGen::CreateArrayWithBuffer(const ir::AstNode *node, uint32_t idx) { ASSERT(util::Helpers::IsInteger(idx)); - sa_.Emit(node, idx); + std::string idxStr = std::string(context_->RecordName()) + std::to_string(idx); + util::UString litId(idxStr, allocator_); + sa_.Emit(node, 0, litId.View()); } void PandaGen::CreateArray(const ir::AstNode *node, const ArenaVector &elements, VReg obj) @@ -1407,22 +1578,23 @@ void PandaGen::CreateArray(const ir::AstNode *node, const ArenaVector(node, array, index); + ra_.Emit(node, array, index); } void PandaGen::ThrowIfNotObject(const ir::AstNode *node, VReg obj) { - ra_.Emit(node, obj); + ra_.Emit(node, obj); } void PandaGen::ThrowThrowNotExist(const ir::AstNode *node) { - sa_.Emit(node); + sa_.Emit(node); } void PandaGen::GetIterator(const ir::AstNode *node) { - sa_.Emit(node); + // modify ic later + sa_.Emit(node, 0); } void PandaGen::GetAsyncIterator(const ir::AstNode *node) @@ -1442,71 +1614,93 @@ void PandaGen::CreateObjectWithExcludedKeys(const ir::AstNode *node, VReg obj, V } size_t argRegCnt = (argCount == 0 ? argCount : argCount - 1); - rra_.Emit(node, argStart, argCount, static_cast(argRegCnt), obj, - argStart); + + if (argRegCnt <= util::Helpers::MAX_INT8) { + rra_.Emit(node, argStart, argCount, static_cast(argRegCnt), + obj, argStart); + return; + } + + rra_.Emit(node, argStart, argCount, static_cast(argRegCnt), + obj, argStart); } void PandaGen::ThrowObjectNonCoercible(const ir::AstNode *node) { - sa_.Emit(node); + sa_.Emit(node); } void PandaGen::CloseIterator(const ir::AstNode *node, VReg iter) { - ra_.Emit(node, iter); + // modify ic later + ra_.Emit(node, 0, iter); } -void PandaGen::DefineClassWithBuffer(const ir::AstNode *node, const util::StringView &ctorId, int32_t litIdx, - VReg lexenv, VReg base) +void PandaGen::DefineClassWithBuffer(const ir::AstNode *node, const util::StringView &ctorId, int32_t litIdx, VReg base) { + // modify ic later auto formalParamCnt = node->AsClassDefinition()->Ctor()->Function()->FormalParamsLength(); - ra_.Emit(node, ctorId, litIdx, static_cast(formalParamCnt), lexenv, base); + std::string idxStr = std::string(context_->RecordName()) + std::to_string(litIdx); + util::UString litId(idxStr, allocator_); + ra_.Emit(node, 0, ctorId, litId.View(), static_cast(formalParamCnt), base); strings_.insert(ctorId); } -void PandaGen::LoadModuleVariable(const ir::AstNode *node, const util::StringView &name, bool isLocalExport) +void PandaGen::LoadLocalModuleVariable(const ir::AstNode *node, const binder::ModuleVariable *variable) { - ra_.Emit(node, name, isLocalExport ? static_cast(1) : static_cast(0)); - strings_.insert(name); + auto index = variable->Index(); + index <= util::Helpers::MAX_INT8 ? sa_.Emit(node, index) : + sa_.Emit(node, index); } -void PandaGen::StoreModuleVariable(const ir::AstNode *node, const util::StringView &name) +void PandaGen::LoadExternalModuleVariable(const ir::AstNode *node, const binder::ModuleVariable *variable) { - sa_.Emit(node, name); - strings_.insert(name); + auto index = variable->Index(); + index <= util::Helpers::MAX_INT8 ? sa_.Emit(node, index) : + sa_.Emit(node, index); } -void PandaGen::GetModuleNamespace(const ir::AstNode *node, const util::StringView &name) +void PandaGen::StoreModuleVariable(const ir::AstNode *node, const binder::ModuleVariable *variable) { - sa_.Emit(node, name); - strings_.insert(name); + auto index = variable->Index(); + index <= util::Helpers::MAX_INT8 ? sa_.Emit(node, index) : + sa_.Emit(node, index); } -void PandaGen::DynamicImportCall(const ir::AstNode *node, VReg moduleSpecifier) +void PandaGen::GetModuleNamespace(const ir::AstNode *node, uint32_t index) { - ra_.Emit(node, moduleSpecifier); + index <= util::Helpers::MAX_INT8 ? sa_.Emit(node, index) : + sa_.Emit(node, index); +} + +void PandaGen::DynamicImportCall(const ir::AstNode *node) +{ + ra_.Emit(node); } void PandaGen::StSuperByName(const ir::AstNode *node, VReg obj, const util::StringView &key) { - ra_.Emit(node, key, obj); + ra_.Emit(node, 0, key, obj); strings_.insert(key); } void PandaGen::LdSuperByName(const ir::AstNode *node, VReg obj, const util::StringView &key) { - ra_.Emit(node, key, obj); + // modify ic later + LoadAccumulator(node, obj); // object is load to acc + sa_.Emit(node, 0, key); strings_.insert(key); } void PandaGen::StSuperByValue(const ir::AstNode *node, VReg obj, VReg prop) { - ra_.Emit(node, obj, prop); + ra_.Emit(node, 0, obj, prop); } -void PandaGen::LdSuperByValue(const ir::AstNode *node, VReg obj, VReg prop) +void PandaGen::LdSuperByValue(const ir::AstNode *node, VReg obj) { - ra_.Emit(node, obj, prop); + // modify ic later + ra_.Emit(node, 0, obj); // prop is in acc } void PandaGen::StoreSuperProperty(const ir::AstNode *node, VReg obj, const Operand &prop) @@ -1541,63 +1735,80 @@ void PandaGen::LoadSuperProperty(const ir::AstNode *node, VReg obj, const Operan } if (std::holds_alternative(prop)) { - LdSuperByValue(node, obj, std::get(prop)); + LoadAccumulator(node, std::get(prop)); + LdSuperByValue(node, obj); return; } ASSERT(std::holds_alternative(prop)); - RegScope rs(this); LoadAccumulatorInt(node, static_cast(std::get(prop))); - VReg property = AllocReg(); - StoreAccumulator(node, property); - LdSuperByValue(node, obj, property); + LdSuperByValue(node, obj); } void PandaGen::LoadLexicalVar(const ir::AstNode *node, uint32_t level, uint32_t slot) { - sa_.Emit(node, level, slot); + if ((level > util::Helpers::MAX_INT8) || (slot > util::Helpers::MAX_INT8)) { + sa_.Emit(node, level, slot); + return; + } + + sa_.Emit(node, level, slot); } void PandaGen::LoadLexicalVar(const ir::AstNode *node, uint32_t level, uint32_t slot, const util::StringView &name) { if (context_->HotfixHelper() && context_->HotfixHelper()->IsPatchVar(slot)) { uint32_t patchSlot = context_->HotfixHelper()->GetPatchLexicalIdx(std::string(name)); - sa_.Emit(node, patchSlot); + sa_.Emit(node, patchSlot); + return; + } + + if ((level > util::Helpers::MAX_INT8) || (slot > util::Helpers::MAX_INT8)) { + sa_.Emit(node, level, slot); return; } - sa_.Emit(node, level, slot); + + sa_.Emit(node, level, slot); } void PandaGen::StoreLexicalVar(const ir::AstNode *node, uint32_t level, uint32_t slot) { - RegScope rs(this); - VReg value = AllocReg(); - StoreAccumulator(node, value); - ra_.Emit(node, level, slot, value); + if ((level > util::Helpers::MAX_INT8) || (slot > util::Helpers::MAX_INT8)) { + ra_.Emit(node, level, slot); + return; + } + + ra_.Emit(node, level, slot); } void PandaGen::StoreLexicalVar(const ir::AstNode *node, uint32_t level, uint32_t slot, VReg value) { - ra_.Emit(node, level, slot, value); + LoadAccumulator(node, value); + if ((level > util::Helpers::MAX_INT8) || (slot > util::Helpers::MAX_INT8)) { + ra_.Emit(node, level, slot); + return; + } + + ra_.Emit(node, level, slot); } void PandaGen::StoreLexicalVar(const ir::AstNode *node, uint32_t level, uint32_t slot, const util::StringView &name) { if (context_->HotfixHelper() && context_->HotfixHelper()->IsPatchVar(slot)) { uint32_t patchSlot = context_->HotfixHelper()->GetPatchLexicalIdx(std::string(name)); - sa_.Emit(node, patchSlot); + sa_.Emit(node, patchSlot); return; } RegScope rs(this); VReg value = AllocReg(); StoreAccumulator(node, value); - ra_.Emit(node, level, slot, value); + StoreLexicalVar(node, level, slot, value); } void PandaGen::ThrowIfSuperNotCorrectCall(const ir::AstNode *node, int64_t num) { - sa_.Emit(node, num); + sa_.Emit(node, num); } void PandaGen::ThrowUndefinedIfHole(const ir::AstNode *node, const util::StringView &name) @@ -1608,7 +1819,7 @@ void PandaGen::ThrowUndefinedIfHole(const ir::AstNode *node, const util::StringV LoadAccumulatorString(node, name); VReg nameReg = AllocReg(); StoreAccumulator(node, nameReg); - ra_.Emit(node, holeReg, nameReg); + ra_.Emit(node, holeReg, nameReg); LoadAccumulator(node, holeReg); strings_.insert(name); } @@ -1619,13 +1830,13 @@ void PandaGen::ThrowConstAssignment(const ir::AstNode *node, const util::StringV LoadAccumulatorString(node, name); VReg nameReg = AllocReg(); StoreAccumulator(node, nameReg); - ra_.Emit(node, nameReg); + ra_.Emit(node, nameReg); strings_.insert(name); } void PandaGen::PopLexEnv(const ir::AstNode *node) { - sa_.Emit(node); + sa_.Emit(node); } void PandaGen::CopyLexEnv(const ir::AstNode *node) @@ -1649,17 +1860,15 @@ void PandaGen::NewLexicalEnv(const ir::AstNode *node, uint32_t num, binder::Vari void PandaGen::NewLexEnv(const ir::AstNode *node, uint32_t num) { - sa_.Emit(node, num); + num <= util::Helpers::MAX_INT8 ? sa_.Emit(node, num) : sa_.Emit(node, num); } void PandaGen::NewLexEnvWithScopeInfo(const ir::AstNode *node, uint32_t num, int32_t scopeInfoIdx) { - sa_.Emit(node, num, scopeInfoIdx); -} - -void PandaGen::LdLexEnv(const ir::AstNode *node) -{ - sa_.Emit(node); + std::string idxStr = std::string(context_->RecordName()) + std::to_string(scopeInfoIdx); + util::UString litId(idxStr, allocator_); + num <= util::Helpers::MAX_INT8 ? sa_.Emit(node, num, litId.View()) : + sa_.Emit(node, num, litId.View()); } uint32_t PandaGen::TryDepth() const @@ -1777,21 +1986,17 @@ VReg PandaGen::LoadPropertyKey(const ir::Expression *prop, bool isComputed) return propReg; } -void PandaGen::StLetToGlobalRecord(const ir::AstNode *node, const util::StringView &name) +void PandaGen::StLetOrClassToGlobalRecord(const ir::AstNode *node, const util::StringView &name) { - sa_.Emit(node, name); + // modify ic later + sa_.Emit(node, 0, name); strings_.insert(name); } void PandaGen::StConstToGlobalRecord(const ir::AstNode *node, const util::StringView &name) { - sa_.Emit(node, name); - strings_.insert(name); -} - -void PandaGen::StClassToGlobalRecord(const ir::AstNode *node, const util::StringView &name) -{ - sa_.Emit(node, name); + // modify ic later + sa_.Emit(node, 0, name); strings_.insert(name); } diff --git a/es2panda/compiler/core/pandagen.h b/es2panda/compiler/core/pandagen.h index afeed11653..eee2c99ac8 100644 --- a/es2panda/compiler/core/pandagen.h +++ b/es2panda/compiler/core/pandagen.h @@ -29,6 +29,7 @@ namespace panda::es2panda::binder { class FunctionScope; +class ModuleVaribale; class ScopeFindResult; class Scope; } // namespace panda::es2panda::binder @@ -61,6 +62,16 @@ enum class Constant { JS_GLOBAL, }; +enum class FunctionKind : uint8_t { + NONE = 0x0, // represent method for now + FUNCTION = 0x1, + NC_FUNCTION = 0x2, + GENERATOR_FUNCTION = 0x3, + ASYNC_FUNCTION = 0x4, + ASYNC_GENERATOR_FUNCTION = 0x5, + ASYNC_NCFUNCTION = 0x6 +}; + class DebugInfo { public: explicit DebugInfo(ArenaAllocator *allocator) : variableDebugInfo(allocator->Adapter()) {}; @@ -192,6 +203,13 @@ public: rra_.SetSourceLocationFlag(flag); } + FunctionKind GetFunctionKind() const + { + return funcKind_; + } + + void SetFunctionKind(); + bool IsDebug() const; bool isDebuggerEvaluateExpressionMode() const; std::string SourceFile() const; @@ -204,8 +222,6 @@ public: Label *AllocLabel(); - VReg LexEnv() const; - bool FunctionHasFinalizer() const; void FunctionInit(CatchTable* catchTable); void FunctionEnter(); @@ -215,7 +231,7 @@ public: int32_t AddLiteralBuffer(LiteralBuffer *buf); int32_t AddLexicalVarNamesForDebugInfo(ArenaMap> &lexicalMap); - void InitializeLexEnv(const ir::AstNode *node, VReg lexEnv); + void InitializeLexEnv(const ir::AstNode *node); void CopyFunctionArguments(const ir::AstNode *node); void GetFunctionObject(const ir::AstNode *node); void GetNewTarget(const ir::AstNode *node); @@ -224,9 +240,8 @@ public: void LoadVar(const ir::Identifier *node, const binder::ScopeFindResult &result); void StoreVar(const ir::AstNode *node, const binder::ScopeFindResult &result, bool isDeclaration); - void StLetToGlobalRecord(const ir::AstNode *node, const util::StringView &name); + void StLetOrClassToGlobalRecord(const ir::AstNode *node, const util::StringView &name); void StConstToGlobalRecord(const ir::AstNode *node, const util::StringView &name); - void StClassToGlobalRecord(const ir::AstNode *node, const util::StringView &name); void StoreAccumulator(const ir::AstNode *node, VReg vreg); void LoadAccFromArgs(const ir::AstNode *node); @@ -240,7 +255,6 @@ public: void LoadAccumulator(const ir::AstNode *node, VReg reg); void LoadGlobalVar(const ir::AstNode *node, const util::StringView &name); void StoreGlobalVar(const ir::AstNode *node, const util::StringView &name); - void StoreGlobalLet(const ir::AstNode *node, const util::StringView &name); void TryLoadGlobalByValue(const ir::AstNode *node, VReg key); void TryStoreGlobalByValue(const ir::AstNode *node, VReg key); @@ -271,6 +285,15 @@ public: void Condition(const ir::AstNode *node, lexer::TokenType op, VReg lhs, class Label *ifFalse); void Unary(const ir::AstNode *node, lexer::TokenType op, VReg operand); void Binary(const ir::AstNode *node, lexer::TokenType op, VReg lhs); + void Equal(const ir::AstNode *node, VReg lhs); + void NotEqual(const ir::AstNode *node, VReg lhs); + void StrictEqual(const ir::AstNode *node, VReg lhs); + void StrictNotEqual(const ir::AstNode *node, VReg lhs); + void LessThan(const ir::AstNode *node, VReg lhs); + void LessEqual(const ir::AstNode *node, VReg lhs); + void GreaterThan(const ir::AstNode *node, VReg lhs); + void GreaterEqual(const ir::AstNode *node, VReg lhs); + void IsTrue(const ir::AstNode *node); void BranchIfUndefined(const ir::AstNode *node, class Label *target); void BranchIfStrictNotUndefined(const ir::AstNode *node, class Label *target); @@ -296,12 +319,11 @@ public: void SuperCall(const ir::AstNode *node, VReg startReg, size_t argCount); void SuperCallSpread(const ir::AstNode *node, VReg vs); - void LoadHomeObject(const ir::AstNode *node); void NewObject(const ir::AstNode *node, VReg startReg, size_t argCount); void DefineFunction(const ir::AstNode *node, const ir::ScriptFunction *realNode, const util::StringView &name); void TypeOf(const ir::AstNode *node); - void NewObjSpread(const ir::AstNode *node, VReg obj, VReg target); + void NewObjSpread(const ir::AstNode *node, VReg obj); void GetUnmappedArgs(const ir::AstNode *node); void Negate(const ir::AstNode *node); @@ -313,15 +335,15 @@ public: void GetResumeMode(const ir::AstNode *node, VReg genObj); void AsyncFunctionEnter(const ir::AstNode *node); - void AsyncFunctionAwait(const ir::AstNode *node, VReg asyncFuncObj, VReg retVal); - void AsyncFunctionResolve(const ir::AstNode *node, VReg asyncFuncObj, VReg value, VReg canSuspend); - void AsyncFunctionReject(const ir::AstNode *node, VReg asyncFuncObj, VReg value, VReg canSuspend); + void AsyncFunctionAwait(const ir::AstNode *node, VReg asyncFuncObj); + void AsyncFunctionResolve(const ir::AstNode *node, VReg asyncFuncObj); + void AsyncFunctionReject(const ir::AstNode *node, VReg asyncFuncObj); void GeneratorYield(const ir::AstNode *node, VReg genObj); void GeneratorComplete(const ir::AstNode *node, VReg genObj); void CreateAsyncGeneratorObj(const ir::AstNode *node, VReg funcObj); void CreateIterResultObject(const ir::AstNode *node, VReg value, VReg done); - void SuspendGenerator(const ir::AstNode *node, VReg genObj, VReg iterResult); + void SuspendGenerator(const ir::AstNode *node, VReg genObj); void SuspendAsyncGenerator(const ir::AstNode *node, VReg asyncGenObj); void AsyncGeneratorResolve(const ir::AstNode *node, VReg asyncGenObj, VReg value, VReg canSuspend); @@ -334,9 +356,8 @@ public: void GetNextPropName(const ir::AstNode *node, VReg iter); void CreateEmptyObject(const ir::AstNode *node); void CreateObjectWithBuffer(const ir::AstNode *node, uint32_t idx); - void CreateObjectHavingMethod(const ir::AstNode *node, uint32_t idx); void SetObjectWithProto(const ir::AstNode *node, VReg proto, VReg obj); - void CopyDataProperties(const ir::AstNode *node, VReg dst, VReg src); + void CopyDataProperties(const ir::AstNode *node, VReg dst); void DefineGetterSetterByValue(const ir::AstNode *node, VReg obj, VReg name, VReg getter, VReg setter, bool setName); void CreateEmptyArray(const ir::AstNode *node); @@ -352,22 +373,21 @@ public: void CreateObjectWithExcludedKeys(const ir::AstNode *node, VReg obj, VReg argStart, size_t argCount); void ThrowObjectNonCoercible(const ir::AstNode *node); void CloseIterator(const ir::AstNode *node, VReg iter); - void DefineClassWithBuffer(const ir::AstNode *node, const util::StringView &ctorId, int32_t litIdx, VReg lexenv, - VReg base); + void DefineClassWithBuffer(const ir::AstNode *node, const util::StringView &ctorId, int32_t litIdx, VReg base); - void LoadModuleVariable(const ir::AstNode *node, const util::StringView &name, bool isLocalExport); - void StoreModuleVariable(const ir::AstNode *node, const util::StringView &name); - void GetModuleNamespace(const ir::AstNode *node, const util::StringView &name); - void DynamicImportCall(const ir::AstNode *node, VReg moduleSpecifier); + void LoadLocalModuleVariable(const ir::AstNode *node, const binder::ModuleVariable *variable); + void LoadExternalModuleVariable(const ir::AstNode *node, const binder::ModuleVariable *variable); + void StoreModuleVariable(const ir::AstNode *node, const binder::ModuleVariable *variable); + void GetModuleNamespace(const ir::AstNode *node, uint32_t index); + void DynamicImportCall(const ir::AstNode *node); void StSuperByName(const ir::AstNode *node, VReg obj, const util::StringView &key); void LdSuperByName(const ir::AstNode *node, VReg obj, const util::StringView &key); void StSuperByValue(const ir::AstNode *node, VReg obj, VReg prop); - void LdSuperByValue(const ir::AstNode *node, VReg obj, VReg prop); + void LdSuperByValue(const ir::AstNode *node, VReg obj); void StoreSuperProperty(const ir::AstNode *node, VReg obj, const Operand &prop); void LoadSuperProperty(const ir::AstNode *node, VReg obj, const Operand &prop); - void LdLexEnv(const ir::AstNode *node); void PopLexEnv(const ir::AstNode *node); void CopyLexEnv(const ir::AstNode *node); void NewLexicalEnv(const ir::AstNode *node, uint32_t num, binder::VariableScope *scope); @@ -388,7 +408,7 @@ public: void SortCatchTables(); void LoadObjByIndex(const ir::AstNode *node, VReg obj, int64_t index); - void LoadObjByValue(const ir::AstNode *node, VReg obj, VReg prop); + void LoadObjByValue(const ir::AstNode *node, VReg obj); void StoreObjByName(const ir::AstNode *node, VReg obj, const util::StringView &prop); void StoreObjByIndex(const ir::AstNode *node, VReg obj, int64_t index); @@ -422,6 +442,16 @@ public: throw Error(ErrorType::GENERIC, "Unimplemented code path"); } + ICSize GetCurrentSlot() const + { + return currentSlot_; + } + + void IncreaseCurrentSlot(ICSlot inc) + { + currentSlot_ += inc; + } + private: ArenaAllocator *allocator_; CompilerContext *context_; @@ -441,6 +471,7 @@ private: SimpleAllocator sa_; RegAllocator ra_; RangeRegAllocator rra_; + ICSize currentSlot_ {0}; uint32_t usedRegs_ {0}; uint32_t totalRegs_ {0}; @@ -455,6 +486,7 @@ private: friend class DynamicContext; friend class OptionalChain; size_t labelId_ {0}; + FunctionKind funcKind_ {FunctionKind::NONE}; }; } // namespace panda::es2panda::compiler diff --git a/es2panda/compiler/core/regAllocator.cpp b/es2panda/compiler/core/regAllocator.cpp index 1601722e66..01f3f81eba 100644 --- a/es2panda/compiler/core/regAllocator.cpp +++ b/es2panda/compiler/core/regAllocator.cpp @@ -21,7 +21,7 @@ namespace panda::es2panda::compiler { -// RegAllocatorBase +// AllocatorBase void AllocatorBase::PushBack(IRNode *ins) { @@ -33,12 +33,10 @@ ArenaAllocator *AllocatorBase::Allocator() const return pg_->Allocator(); } -// SimpleAllocator - -Label *SimpleAllocator::AllocLabel(std::string &&id) +void AllocatorBase::UpdateIcSlot(IRNode *node) { - const auto *lastInsNode = pg_->Insns().empty() ? FIRST_NODE_OF_FUNCTION : pg_->Insns().back()->Node(); - return Alloc